STARs Posted April 1, 2013 Report 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
Moderators Kyle Posted April 1, 2013 Moderators Report Posted April 1, 2013 Try this... <?php echo substr_count($pirep->log,"paused"); ?> 1 Quote
STARs Posted April 2, 2013 Author Report 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
Sava Posted April 2, 2013 Report 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
STARs Posted April 2, 2013 Author Report 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
Oxymoron290 Posted April 3, 2013 Report Posted April 3, 2013 Give a man a fish, he eats for a day... 1 Quote
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.