far2slow Posted July 20, 2011 Share Posted July 20, 2011 $gonline = $json['response'][0]['user']['is_online']; so $gonline can be 0 or 1 i know i can do it like if ($gonline=="0") echo "Off line"; else echo "Online"; but i want to echo the result later on in the script in the line <img src="', $member['online']['image_href'], '" alt="', $member['online']['link'], '" /> <span class="smalltext">', $member['link'], ' ', $gonline, '</span><br />'; Link to comment https://forums.phpfreaks.com/topic/242460-if-else/ Share on other sites More sharing options...
requinix Posted July 20, 2011 Share Posted July 20, 2011 echo ' ', $member['link'], ' '; if ($gonline=="0") echo "Off line"; else echo "Online"; echo ' '; Link to comment https://forums.phpfreaks.com/topic/242460-if-else/#findComment-1245288 Share on other sites More sharing options...
far2slow Posted July 20, 2011 Author Share Posted July 20, 2011 thanks did try that but didnt put the ; in solved thanks again Link to comment https://forums.phpfreaks.com/topic/242460-if-else/#findComment-1245300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.