Convert date using strtotime from DOMDocument element

AlM

New Member
I'm parsing some data using DOMDocument after fetching HTML file using curl. The codes look like this\[code\]$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}\[/code\]I can't convert \[code\]$var\[/code\] to a timestamp using strtotime. I don't know why, I know \[code\]$cols->item(1)->nodeValue\[/code\] 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 \[code\]strtotime('11 Jan 2010');\[/code\]and it did return a timestamp, so, what should I do ?
 
Back
Top