Jump to content


Photo

no lin breaks?


  • Please log in to reply
2 replies to this topic

#1 putnamehere

putnamehere
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 09 April 2006 - 05:37 PM

is they anyway i can take away line breaks from text.. example.

Text:
This.
That.
The other.

What i want it to be:
This. That. The other.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 09 April 2006 - 05:40 PM

Simple:
$str = "String<br />with <br />line breaks<br />";
$str = str_replace("<br />", "", $str);

echo $str;


#3 putnamehere

putnamehere
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 09 April 2006 - 06:08 PM

[!--quoteo(post=363052:date=Apr 9 2006, 12:40 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 9 2006, 12:40 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Simple:
$str = "String<br />with <br />line breaks<br />";
$str = str_replace("<br />", "", $str);

echo $str;
[/quote]

it works but i want to write "$str" to a file and for that it dosent work any ideas y?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users