Re: Splitting up big strings

From: Date: Wed, 26 Feb 2003 18:17:03 +0000
Subject: Re: Splitting up big strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137289@lists.php.net to get a copy of this message
On Thu, 27 Feb 2003 01:02:54 +0800, Jason Wong wrote: >On Thursday 27 February 2003 00:54, {R}ichard Ashton wrote: >> I have the body ov a Usnet article, all of it, in $body. I want to >> split it into lines. >> >> I have tried >> >> $lines = explode( X, $body); >> >> where I have used >> >> X = "0x0A" >> X = '0x0A' >> X = "0x0D" >> X = '0x0A' >> X = "\r" > >Try "\n". If I hadn't pushed send by mistake I would have added X = "\r" X = '\r' X = "\n" X = '\n' I then have echo "pieces $pieces[0] <br>"; echo "pieces $pieces[1] <br>"; echo "pieces $pieces[2] <br>"; echo "pieces $pieces[3] <br>"; echo "pieces $pieces[4] <br>"; echo "pieces $pieces[5] <br>"; If I look at $body with Hex editor there are lots of 0D 0A pairs and further if I look at the source of the page generated by echo $body; I can see the CRLF's This is giving me pains in the neck :( {R}

« previous php.general (#137289) next »