shane18 Posted September 20, 2009 Share Posted September 20, 2009 when you do if($BLAH = $BLAH2) ... that makes $BLAH value = $BLAH2.... and if that makes $BLAH higher than 0(aka makes it true)... it makes the if statement true? i been coding with unanwsered questions.. and now i been on here helpin with easy stuff and asking questions to improve my knowledge more Quote Link to comment Share on other sites More sharing options...
5kyy8lu3 Posted September 20, 2009 Share Posted September 20, 2009 when you do if($BLAH = $BLAH2) ... that makes $BLAH value = $BLAH2.... and if that makes $BLAH higher than 0(aka makes it true)... it makes the if statement true? i been coding with unanwsered questions.. and now i been on here helpin with easy stuff and asking questions to perfect my knowledge more yea if you use a single equals sign it equates to true, but I'm not sure if that's what you're asking Quote Link to comment Share on other sites More sharing options...
shane18 Posted September 20, 2009 Author Share Posted September 20, 2009 if $BLAH = NULL, and $BLAH2 = 6... if you do if($BLAH = $BLAH2) that will be true because $BLAH now has the value of 6.. which makes the statement true right? Quote Link to comment Share on other sites More sharing options...
corbin Posted September 20, 2009 Share Posted September 20, 2009 $a = $b will return what ever the value of $b is: $b = true; if($a = $b) //true $b = 1; if($a = $b) //true $b = '1'; if($a = $b) //true $b = false; if($a = $b) //false You get the point. Quote Link to comment Share on other sites More sharing options...
shane18 Posted September 20, 2009 Author Share Posted September 20, 2009 $a = $b will return what ever the value of $b is: $b = true; if($a = $b) //true $b = 1; if($a = $b) //true $b = '1'; if($a = $b) //true $b = false; if($a = $b) //false You get the point. then from that point forward... $BLAH = 0; $BLAH2 = 6; if($BLAH = $BLAH2)//Equals TURE and then echo $BLAH would display 6 right? Quote Link to comment Share on other sites More sharing options...
5kyy8lu3 Posted September 20, 2009 Share Posted September 20, 2009 $a = $b will return what ever the value of $b is: $b = true; if($a = $b) //true $b = 1; if($a = $b) //true $b = '1'; if($a = $b) //true $b = false; if($a = $b) //false You get the point. then from that point forward... $BLAH = 0; $BLAH2 = 6; if($BLAH = $BLAH2)//Equals TURE and then echo $BLAH would display 6 right? you're basically saving the contents of $blah2 into $blah, then using $blah to test for true/false. so basically, as long as $blah2 doesn't contain 0, null, or false, it should be true. Quote Link to comment Share on other sites More sharing options...
shane18 Posted September 20, 2009 Author Share Posted September 20, 2009 thanks man for clearing that up 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.