Re: adding a symbol in front of each line

From: Date: Wed, 17 Nov 2004 15:15:55 +0000
Subject: Re: adding a symbol in front of each line
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-202308@lists.php.net to get a copy of this message
Chris Boget wrote:
Hi there, I would like to add a > symbol infront of each line I pull out of a
database.
Similar to the function seen in online e-mail clients when you click on
reply.
Has anybody an idea on how to add a symbol in front of each line?`
Should be simple enough using explode() followed by implode(). thnx, Chris
Hi, actually that is not as easy as it looks. Lets say we want to ad a \n after each 80 characters. There is always the problem what happens if the line has already a \n inside. E.g: This is a sample text. This is a sample text. This is a sample text Should result in:
This is a sample text. This is a sample text. This is a sample text
That looks very complicated to me. Can anybody point me into the right direction? Thanx for any help, Merlin

« previous php.general (#202308) next »