piney Posted July 16, 2006 Share Posted July 16, 2006 I have set $s8 - $s12 as names[code]<?php$loop = 8;$time = date('H') - 12;while ($loop <= 12) {if ($s['$loop'] == Lavish) && ($time == $loop) { echo "Lavish is playing now!";}elseif ($s['$loop'] == Lavish) && ($time > $loop) { echo "Lavish is played at $loop";}elseif ($s['$loop'] == Lavish) && ($time < $loop) { echo "Lavish is playing at $loop";}else echo 'Lavish is not playing this week'; $loop++;}?>[/code]I get error "unexpected T_BOOLEAN_AND"any ideas?? Link to comment https://forums.phpfreaks.com/topic/14748-playing-time/ Share on other sites More sharing options...
Joe Haley Posted July 16, 2006 Share Posted July 16, 2006 if ($s['$loop'] == Lavish) && ($time == $loop)Should beif (($s['$loop'] == Lavish) && ($time == $loop) )Missed a set of brackets on all conditions. Link to comment https://forums.phpfreaks.com/topic/14748-playing-time/#findComment-58866 Share on other sites More sharing options...
piney Posted July 16, 2006 Author Share Posted July 16, 2006 That worked but my code dont work... if $loop = 10$s['$loop'] should = $s10 right???or how would i get that to work??? Link to comment https://forums.phpfreaks.com/topic/14748-playing-time/#findComment-58926 Share on other sites More sharing options...
sasa Posted July 16, 2006 Share Posted July 16, 2006 if $loop =10 then[code]${'s'.$loop}[/code]is $s10 Link to comment https://forums.phpfreaks.com/topic/14748-playing-time/#findComment-58930 Share on other sites More sharing options...
piney Posted July 17, 2006 Author Share Posted July 17, 2006 Thank you ;D Link to comment https://forums.phpfreaks.com/topic/14748-playing-time/#findComment-59257 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.