Re: [PHP] Removing line breaks...

2004-04-17 Thread -{ Rene Brehmer }-
str_replace(\n,'',$string);

don't think it'd be any faster with the regex ones...

Rene

At 01:18 18-04-2004, Russell P Jones wrote:
How do i turn this...

[br]
  [b]My Title [/b]
[br]
into

[br][b]My Title[/b][br]

--- I just need to have line breaks removed basically...

any ideas?

Russ Jones
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Removing line breaks...

2004-04-17 Thread Daniel Clark
str_replace( $line, '\n', '')

http://us2.php.net/manual/en/function.str-replace.php

How do i turn this...

[br]
  [b]My Title [/b]
[br]

into

[br][b]My Title[/b][br]


--- I just need to have line breaks removed basically...

any ideas?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] removing line breaks

2003-12-05 Thread Robert Cummings
On Fri, 2003-12-05 at 03:53, Roel Derckx wrote:
 Hi
 
 I want to remove line breaks from the front of a string, but i can't get it
 to work. Who can help me?
 
 The code i tried is:
 while(substr($body,0,1)==\n) $body=substr($body,1);
 
 i also tried:
 while(substr($body,0,2)==\n) $body=substr($body,2);
 but this doesn't work either.

This should work:

$string = ereg_replace( ^[\n\r]+, '', $string );

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] removing line breaks

2003-12-05 Thread Leif K-Brooks
Roel Derckx wrote:

I want to remove line breaks from the front of a string, but i can't get it
to work. Who can help me?
Note that i only want to remove line breaks in the start of the string, all line 
breaks in
the rest of the string should remain.
ltrim()

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php