regular expression php [closed]

0

I'm trying to get a whole source code from a website.

using CURL I used the regular expression

    preg_match('/<html>(.*)<\/html>/i', $resultado, $codigo);
    echo $codigo = $codigo[1];  

But it did not work ... where is the error?

    
asked by anonymous 25.01.2017 / 20:39

1 answer

3

You can display the source code of a page with highlight_string() , which prevents it from being rendered by the browser, so something like:

highlight_string($resultado);
    
25.01.2017 / 20:59