![]() Topic awaiting preservation: preg_replace doesn't replace (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() I've got a page with a bunch of preg_replace calls (I'm doing a web scraping project). All of them work except for this one: code: $code = preg_replace("(<b>Printer-Friendly Versions \(pdf & html\) of this Section<\/b> <font color=\"black\">- all combined into one document<\/a><\/small><br>)si","", $code);
code: <b>Printer-Friendly Versions (pdf & html) of this Section</b> <font color="black">- all combined into one document</font></a></small><br> . |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() There's no closing font tag in the preg |
Maniac (V) Mad Scientist From: :morF |
![]() yep, bit nailed it. SInce there' no closing font tag the preg_replace can't find the specific string. It don't exist cobber. Silly mistake, I know, but we all have them, and it seems the longer you examine your code the less likely it is you'll find it. Believe me. I once spent 4 hours searching a piece of Java code for an error, only to find I'd entered 'BuggeredReader' instead of 'BufferedReader'. I only found it after I went to bed, slept and came back to it the next morning. |