STARs Posted April 1, 2013 Report Share Posted April 1, 2013 hi i want to count the number of Pauses in a particulor PIREP could you guide me how can i do that. i.e SIMULATOR PAUSED SIMULATOR UN-PAUSED SIMULATOR PAUSED SIMULATOR UN-PAUSED SIMULATOR PAUSED SIMULATOR UN-PAUSED Total Pauses: 3 I want to count the number of SIMULATOR PAUSED in a log file. Please guide. Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted April 1, 2013 Moderators Report Share Posted April 1, 2013 Try this... <?php echo substr_count($pirep->log,"paused"); ?> 1 Quote Link to comment Share on other sites More sharing options...
STARs Posted April 2, 2013 Author Report Share Posted April 2, 2013 Try this... <?php echo substr_count($pirep->log,"paused"); ?> Thanks it works. Could you also guide me the following: 1. how can i like make the pauses count font red like if the toal pauses are more than 10 it should show it as red in PIREP. 2. I want to show in PIREP Rank check I mean if pilot has flown according to his rank than it should say OK otherwise it should show in RED no. Thanks! Quote Link to comment Share on other sites More sharing options...
Sava Posted April 2, 2013 Report Share Posted April 2, 2013 1. <?php $pause_count = substr_count($pirep->log, "paused"); if ($pause_count > 10) { echo '<span style="color:red">Paused '.$pause_count. ' times.</span>'; } else { echo 'Paused'. $pause_count. ' times.'; } ?> Quote Link to comment Share on other sites More sharing options...
STARs Posted April 2, 2013 Author Report Share Posted April 2, 2013 1. <?php $pause_count = substr_count($pirep->log, "paused"); if ($pause_count > 10) { echo '<span style="color:red">Paused '.$pause_count. ' times.</span>'; } else { echo 'Paused'. $pause_count. ' times.'; } ?> Thank's it worked. Waiting for the second one.... Quote Link to comment Share on other sites More sharing options...
Oxymoron290 Posted April 3, 2013 Report Share Posted April 3, 2013 Give a man a fish, he eats for a day... 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.