ajax - DOM parsing with php is returning zero child elements -


i want extract url data facebook. using php domdocument.while retrieving dom content i.e while retrieving "title" domdocument returning 0 elements. here code

    <?php     header("content-type: text/xml");     echo '<?xml version="1.0" encoding="utf-8" ?>';         //$url = $_request["url"];     $url = "http://business.tutsplus.com/articles/how-to-set-up-your-first-magento-store--fsw-43137";     $ch = curl_init();     curl_setopt($ch,curlopt_url,$url);     curl_setopt($ch,curlopt_header,0);     curl_setopt($ch,curlopt_returntransfer,1);     curl_setopt($ch,curlopt_followlocation,1);     curl_setopt($ch,curlopt_ssl_verifypeer,false);     $data = curl_exec($ch);     curl_close($ch);     $dom = new domdocument();     @$dom->loadhtml($data);     $title = $dom->getelementsbytagname("title");     //$title = $dom->find("title");     echo "<urldata>";         echo "<title>";             echo $title->length;         echo "</title>";     echo "</urldata>"; ?> 

here $title->length returning 0 elements. problem?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -