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; ?> Quote Link to comment 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']); Quote Link to comment 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']); Quote Link to comment 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.