Beauford Posted June 5, 2009 Share Posted June 5, 2009 Can someone explain why the first example below works and the second doesn't. The second example doesn't remove the spaces. Thanks. echo $trimmed = trim($c['usr2']); echo"<td width='34%'>".$gangPREF."<a href='../viewuser.php?u={$c['uid2']}' {$csscode[$c['ul2']-1]}> ".trim($c['usr2'])."</a> [{$c['uid2']}] {$RM}</td> Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 5, 2009 Share Posted June 5, 2009 Could it be that in your second case, there are a few spaces in the string between > and trim()? Quote Link to comment Share on other sites More sharing options...
Beauford Posted June 5, 2009 Author Share Posted June 5, 2009 Could it be that in your second case, there are a few spaces in the string between > and trim()? There is supposed to be, and it does display - just with all the spaces. It's not trimming them. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted June 5, 2009 Share Posted June 5, 2009 Why don't you make double sure that $c['usr2'] has what you expect it to have in it? echo "***<br/>" . htmlentities( $c['usr2'], ENT_QUOTES ) . "<br />***<br />"; echo "***<br/>" . htmlentities( trim( $c['usr2'] ), ENT_QUOTES ) . "<br />***<br />"; 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.