spires Posted December 16, 2008 Share Posted December 16, 2008 Hi guys, for some reason I can't get ! to work. if (!$var_mobile_number[1] == '7'){ echo 'yes'; }else{ echo 'no'; } I want it so if $var_mobile_number[1] is not == to 7 then echo yes. But this does not seem to work. Any ideas? Thanks Quote Link to comment Share on other sites More sharing options...
burnside Posted December 16, 2008 Share Posted December 16, 2008 Hi guys, for some reason I can't get ! to work. if (!$var_mobile_number[1] == '7'){ echo 'yes'; }else{ echo 'no'; } I want it so if $var_mobile_number[1] is not == to 7 then echo yes. But this does not seem to work. Any ideas? Thanks May need a bit more code. Quote Link to comment Share on other sites More sharing options...
gevans Posted December 16, 2008 Share Posted December 16, 2008 if ($var_mobile_number[1] != '7'){ echo 'yes'; }else{ echo 'no'; } Quote Link to comment Share on other sites More sharing options...
Adam Posted December 16, 2008 Share Posted December 16, 2008 Perhaps: if ($var_mobile_number{1} != '7'){ echo 'yes'; }else{ echo 'no'; } Quote Link to comment Share on other sites More sharing options...
burnside Posted December 16, 2008 Share Posted December 16, 2008 is var $var_mobile_numbr[1] even = 7 ? Quote Link to comment Share on other sites More sharing options...
spires Posted December 16, 2008 Author Share Posted December 16, 2008 Thats excellent gevans I new it had to be something like that. Cheers 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.