I created this function to fetch the contents of a url with curl
function leggiUrl($url){
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    $content = curl_exec($ch);
    curl_close($ch);
    return $content;
}
if I enter a URL whose content is partly generated by a script JavaScript, this text is taken from the function. I would like to grab the text (finished) of any page. Thank you.
 
     
    