Based on php

QuestionsCategory: QuestionsBased on php
aa asked 6 months ago

Hi there are  four routes
it has 5 stops of bus
Any bus visiting the same route(for example: we have 4 routes a,b,c,d—–> if bus visiting ‘a’ routes thrice times count should be done), need to identify number of count.
 
then any bus who routes matches the minimum 3times,need to change the bus route.
 
can u please tell me logic of this
 

therichposts replied 6 months ago

you want login in php?

2 Answers
therichpost answered 6 months ago

Please check now
$maxroutes = 3;
   for($bus = 1; $bus <= $maxroutes; $bus++)
   {
    if($bus == $maxroutes)
    {
      echo “route done”;
      break;
    }
   }

therichpost answered 6 months ago

Please check now:

 
$maxroutes = 3;
$busstop = 5;
 
 
   for($busreach = 1; $busreach <= $maxroutes; $busreach++)
   {
 
      for($final = 1; $final<=$busstop; $final++)
      {
        if($busreach == $maxroutes)
        {
          echo “Bustop $final Limit Reached to $busreach now move to Bustop “. ($final+1) .”<br>”;
          
        }
      }
 
   }

Your Answer

17 + 19 =