supermerc Posted March 24, 2007 Share Posted March 24, 2007 This isnt working and I dont know why <?php if('$profile_info[level]' > 0) { echo "<h1><span style=\"color: red;\">{$profile_info['username']}</span>"; } else { echo "<h1>{$profile_info['username']}"; } ?> The level is correct I tried echoing it out already and it shows the correct number for each but the username shows up as black even if the level is greater than 1 Link to comment https://forums.phpfreaks.com/topic/44152-if-and-else/ Share on other sites More sharing options...
dswain Posted March 24, 2007 Share Posted March 24, 2007 I believe you'll need to take the quotes off of the $profile_info variable within the if condition. I think you meant to put those around the level text. if ($profile_info['level'] > 0) { ... } Link to comment https://forums.phpfreaks.com/topic/44152-if-and-else/#findComment-214383 Share on other sites More sharing options...
suzzane2020 Posted March 24, 2007 Share Posted March 24, 2007 yup exactly if($profile_info["level"] > 0) careful about the usage of quotes Link to comment https://forums.phpfreaks.com/topic/44152-if-and-else/#findComment-214388 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.