Re: Splitting up big strings
| From: | Chris Hayes | Date: | Tue, 04 Mar 2003 14:06:00 +0000 |
| Subject: | Re: Splitting up big strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138107@lists.php.net to get a copy of this message | ||
At 19:17 26-2-03, you wrote:
On Thu, 27 Feb 2003 01:02:54 +0800, Jason Wong wrote: On Thursday 27 February 2003 00:54, {R}ichard Ashton wrote:I think 0D0A is "\r\n" (double quotes!). Maybe you can start with str_replacing all "\r\n" and "\r" with "\n" so you can explode by "\n" only. Use double quotes for best result. Chris H.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'sI 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"