frank_solo Posted May 18, 2013 Share Posted May 18, 2013 Trim does not work on this. Am I doing it wrong? Thanks <?php $profile = trim("".$result['profilepic'].""); $pic = !empty($profile) ? "<img src='http://www.mydomain.co/user/".$result['profilepic']." width='100'>" : "<img src=\"http://www.mydomain.co/images/avatar.jpg\" width='100'>";?> <? echo $pic; ?> Link to comment https://forums.phpfreaks.com/topic/278138-trim-question/ Share on other sites More sharing options...
DaveyK Posted May 18, 2013 Share Posted May 18, 2013 What ist he value of $result['profilepic'] before trim() and what is it after? Use var_dump() please. also, why are you doing this $profile = trim("".$result['profilepic'].""); instead of $profile = trim($result['profilepic']); Link to comment https://forums.phpfreaks.com/topic/278138-trim-question/#findComment-1430858 Share on other sites More sharing options...
frank_solo Posted May 18, 2013 Author Share Posted May 18, 2013 Thanks DaveyK that was the problem don't know why I was doing that. $profile = trim($result['profilepic']); Link to comment https://forums.phpfreaks.com/topic/278138-trim-question/#findComment-1430872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.