gevo12321 Posted December 12, 2008 Share Posted December 12, 2008 is it possible to put 2 arguments in an if statement or would i have to put an if statement within another if statement. for example could i do the following? if so what would be the code? if the carpet is blue and the chair is red then bla or do i have to if the carpet is blue then if the chair is red then bla Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 12, 2008 Share Posted December 12, 2008 if ($carpet == "blue") {echo "blue blah";} elseif ($carpet == "red") {echo "red blah";} Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted December 12, 2008 Share Posted December 12, 2008 You could do this: if(($carpet == "blue") && ($chair == "red")) { do this } Both of those values would have to be true for it to do it tho. Quote Link to comment Share on other sites More sharing options...
gevo12321 Posted December 12, 2008 Author Share Posted December 12, 2008 thank you Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted December 12, 2008 Share Posted December 12, 2008 i would also read up on your comparison operators http://us3.php.net/operators.comparison 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.