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?
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?
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);