PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
IonutZ
Forum Newbie
Posts: 4 Joined: Wed Apr 19, 2006 7:04 pm
Location: Troy, MI
Contact:
Post
by IonutZ » Wed Apr 19, 2006 7:07 pm
Hey guys,
Basically if anyone has any idea how to do this ::
to
This would be done in a string which is then echoed for output... I've tried str_replace but no luck
Any ideas guys?
Thanks,
IonutZ
method_man
Forum Contributor
Posts: 257 Joined: Sat Mar 19, 2005 1:38 am
Post
by method_man » Wed Apr 19, 2006 7:44 pm
ummmm get rid of the <br>?
IonutZ
Forum Newbie
Posts: 4 Joined: Wed Apr 19, 2006 7:04 pm
Location: Troy, MI
Contact:
Post
by IonutZ » Wed Apr 19, 2006 7:49 pm
There is no <br>
The text shown up there is how its shown in View Source...
Now I need to load this text into Flash and therefore any break in the code (is like pressing enter in word) and it shows up bad
IonutZ
Forum Newbie
Posts: 4 Joined: Wed Apr 19, 2006 7:04 pm
Location: Troy, MI
Contact:
Post
by IonutZ » Wed Apr 19, 2006 8:08 pm
Code: Select all
$myContent = str_replace('\n', '', $myContent);
$myContent = str_replace("\n", "", $myContent);
Those two don't do it
< still there
You can look at the output of the script ::
http://ionutz.biz/myspace/comments.php
If you look at the source you'll see what I'm saying...
Thanks
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Wed Apr 19, 2006 8:31 pm
You need to check for "\n", "\r" and "\n\r". Do a str_replace of all of those with an empty string and it should put you on the right track (although it will eliminate all line feeds, including the one that would give you the break you actually want). But play with it. I'm sure you'll figure it out.
IonutZ
Forum Newbie
Posts: 4 Joined: Wed Apr 19, 2006 7:04 pm
Location: Troy, MI
Contact:
Post
by IonutZ » Wed Apr 19, 2006 8:45 pm
haha works
! 10x