SF23103 Posted October 22, 2011 Share Posted October 22, 2011 Hello, I have been messing around with this and can't seem to figure out what I'm doing wrong. I'm pretty new to php, so it might be something silly. Original code: $a1=mysql_result($result,$i,"question"); //Question $a2=mysql_result($result,$i,"answer"); //Answer $a3=mysql_result($result,$i,"submission_id"); //submission id $a4=mysql_result($result,$i,"category"); //submission id echo "<a name=\"$a3\"></a><strong>$a1</strong>$a2"; Prints: Question Category What I want is: Question Category I have tried using the trim functions but nothing seems to help: $a1=mysql_result($result,$i,"question"); //Question $a2=mysql_result($result,$i,"answer"); //Answer $a3=mysql_result($result,$i,"submission_id"); //submission id $a4=mysql_result($result,$i,"category"); //submission id $a1 = rtrim($a1); $a2 = ltrim($a2); echo "<a name=\"$a3\"></a><strong>$a1</strong>$a2"; Ideas? Link to comment https://forums.phpfreaks.com/topic/249582-trim-function-help/ Share on other sites More sharing options...
SF23103 Posted October 22, 2011 Author Share Posted October 22, 2011 After looking at the source, it seems that my WYSIWYG editor was feeding <p> tags into it. I used $a2 = trim($a2,"<p>"); to remove the <p> tags until I can figure out how to have the WYSYWIG editor stop doing that. Solved! Link to comment https://forums.phpfreaks.com/topic/249582-trim-function-help/#findComment-1281321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.