Ho can I get the data-time value from the following code with xpath->query in php
<span class="timestamp" data-time="1395846963">33m</span>
Try this, using DOMDocument and DOMXPath
$str = '<span class="timestamp" data-time="1395846963">33m</span>';
$DOM = new DOMDocument();
$DOM->loadHTML($str);
$XPATH = new DOMXPATH($DOM);
$r = $XPATH->query("//span/@data-time");
var_dump($r->item(0)->nodeValue);