Hi there
I'm parsing some data using DOMDocument after fetching HTML file using curl. The codes look like this
$dom = new DOMDocument();
@$dom->loadHTML($content);
$tables = $dom->getElementsByTagName('table');
$rows = $tables->item($tblNum)->getElementsByTagName('tr');
foreach ($rows as $row) {
$cols = $row->getElementsByTagName('td');
$var = $cols->item(1)->nodeValue; // The problem is here
}
I can't convert $var
to a timestamp using strtotime. I don't know why, I know $cols->item(1)->nodeValue
returned the value I want, I even tried exploing and imploding it into another variable, but I still can't convert it to a timestamp using strtotime. I've also tested the value directly
strtotime('11 Jan 2010');
and it did return a timestamp, so, what should I do ?