When I'm parsing a site, and print out the plaintext, I get a lot of newline characters in the printout that can't be removed via a str_replace.
For example, if I parse eBay and look for the end time,
$ebayEndTime = $this->html_simple_dom->find( 'span[class=vi-tm-left]', 0 )->plaintext;
In the print out, it looks like this:
\t\t\t\t\t(Mar 19, 2013\n\t\t\t\t\t15:10:11 PDT)\n\t\t\t
Trying to remove it has no effect:
$search = array('\n', '\t', '\r');
error_log("end time:" . str_replace( $search, " ", $ebayEndTime));
Still results in:
\t\t\t\t\t(Mar 19, 2013\n\t\t\t\t\t15:10:11 PDT)\n\t\t\t
What do I need to do to remove the newlines/tabs? I've even tried this to be thorough:
$search = array('\n', '\t', '\r', '\\n', '\\t', '\\r', '\\\\n', '\\\t', '\\\r', '\\\\n', '\\\\t', '\\\\r');
As I know that Java requires that the escape character be escaped, but as this prints in the log file, is it printing it out as using the html code for '\'?