在PHP中使用DOM时解析错误[重复]

This question already has an answer here:

I am trying to get no. of followers by scraping Instagram. Using following code:

<?php
    function callInstagram($url)
    {
        $ch = curl_init();
        curl_setopt_array($ch, array(
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_SSL_VERIFYHOST => 2));

        $result = curl_exec($ch);
        curl_close($ch); 

        return $result;
    } 

    $url = "https://www.instagram.com/ravij28/";
    $dom = new domDocument();  
    $dom->loadHTML($result); 
    $dom->preserveWhiteSpace = false; 
    $tables = $dom->getElementsByTagName('script type'); 
    ?>

error:

Parse error: syntax error, unexpected '$dom' (T_VARIABLE) in C:\wamp\www\Trial\curl.php on line 20

Please suggest some solution.

</div>
function callInstagram($url)
{
    $ch = curl_init();
    curl_setopt_array($ch, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => 2));
    $result = curl_exec($ch);
    curl_close($ch); 
    return $result;
} 
$url = "https://www.instagram.com/ravij28/";
$dom = new domDocument();  
$dom->loadHTML(callInstagram($url)); 
$dom->preserveWhiteSpace = false; 
$tables = $dom->getElementsByTagName('script'); 
print_r($tables);

this show DOMNodeList Object ( [length] => 11 ) AND

 $tables = $dom->getElementsByTagName('script type'); 
print_r($tables);

Show DOMNodeList Object ( [length] => 0 )