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?? Quote 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. Quote 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??? Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/14748-playing-time/#findComment-59257 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.