Парсинг на PHP (fopen, curl, file_get_contents)
Category: Parsing, PHP code examples
$homepage = file_get_contents('http://www.example.com/'); echo $homepage;
$handle = curl_init(); curl_setopt($handle, CURLOPT_URL, "http://www.example.com/"); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); $homepage = curl_exec($handle); curl_close($handle); echo $homepage;
$file = fopen ('http://www.example.com/', 'r'); $homepage = ""; while (!feof ($file)){ $homepage .= fread ($file, 512); } fclose ($file); echo $homepage;