Xtremer360 Posted November 19, 2010 Share Posted November 19, 2010 I have this as my code: if(!empty($stipulation)){ if($stipulation == "Championship Title Match"){ print "<h3 class=title>".$title." Match</h3>"; } else{ print "<h3 class=stipulation>".$stipulation."</h3>"; } } however I'm wanting to make it to where if it $stipulation has a value then it echos it and nothing if it doesn't have a value then don't nothing else happens. I also need a similiar if statement that will check to see if there is a value for $title and if there is then it echos $title Championship Match and again if no value exists it does nothing. Quote Link to comment https://forums.phpfreaks.com/topic/219216-if-statement-trouble/ Share on other sites More sharing options...
Adam Posted November 19, 2010 Share Posted November 19, 2010 You mean like..? if (!empty($stipulation)) { echo '<h3 class="title">'; if (!empty($title)) { echo $title . ' '; } echo 'Championship Match</h3>'; } Quote Link to comment https://forums.phpfreaks.com/topic/219216-if-statement-trouble/#findComment-1136778 Share on other sites More sharing options...
Xtremer360 Posted November 19, 2010 Author Share Posted November 19, 2010 Partly there. Only thing is stipulation and title are going to be to different things like say for the variable title it could say UFC title match and below it could say for example Loser Retires or something Quote Link to comment https://forums.phpfreaks.com/topic/219216-if-statement-trouble/#findComment-1136791 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.