egturnkey Posted March 15, 2010 Share Posted March 15, 2010 Hello dear friends, Let's says we have $manal = "zzzz"; and $soliman = "yyyy"; and $shams ="xxxx"; then how we say the following !! if $s = $manal show 111111 and if $s = $soliman show 22222 and if $s = $shams show 333333 else show 444444 second case if there any if (x or y ) i means if i want to say if $s = $manal or $shams then show 11111 else show 22222 thanks for help, it will makes me understand how if/and if /else working > Link to comment https://forums.phpfreaks.com/topic/195282-if-and-if-not-and-else/ Share on other sites More sharing options...
trq Posted March 15, 2010 Share Posted March 15, 2010 You practically wrote the answer yourself. if ($s= = $manal) { echo '111111'; } elseif ($s == $soliman) { echo '22222'; } elseif ($s == $shams) { echo '333333'; } else { echo '444444'; } Link to comment https://forums.phpfreaks.com/topic/195282-if-and-if-not-and-else/#findComment-1026228 Share on other sites More sharing options...
trq Posted March 15, 2010 Share Posted March 15, 2010 if ($s == $manal || $s == $shams) { echo '11111'; } else { echo '22222'; } Link to comment https://forums.phpfreaks.com/topic/195282-if-and-if-not-and-else/#findComment-1026229 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.