|
Posted by John Dunlop on 11/18/56 11:44
basement_addict@yahoo.com:
> I am trying to remove all the headers in a text file.
>
> I tried this preg_replace('/^.*\n/', '',$body) but it only removed the
> first one.
It matches up to the first line-feed character. You want it to match
up to the first occurrence of two consecutive line-feeds (the first two
consecutive carriage-return/line-feed pairs, \r\n\r\n, perhaps?).
Remember the s modifier so that the dot matches any single line-feeds.
HTH.
--
Jock
Navigation:
[Reply to this message]
|