I tried through curl ... and again the answer is empty (

<?php ob_start(); $ch = curl_init("http://forum3.ru/cgi/shop/ishop.pl?cmd=show_tovar&code=91100&xhr=1"); curl_setopt($ch, CURLOPT_USERAGENT, "Opera/9.63 (Windows NT 5.1; U; ru) Presto/2.1.1"); $result = curl_exec($ch); if( !$result ) $error = curl_error($ch); curl_close($ch); $content = ob_get_contents(); ob_end_clean(); // $content ΠΌΠΎΠΆΠ½ΠΎ Π³Ρ€Π°Π±ΠΈΡ‚ΡŒ (// я ΠΏΠΎ старинкС ) $fromBodyToBody = substr($content, strpos($content, '<body>')+6); $fromBodyToBody = substr($fromBodyToBody, 0, strpos($fromBodyToBody, '</body>')); // Π²ΠΎΡ‚ ΠΊΠΎΠ½Ρ‚Π΅Π½Ρ‚ ΠΌΠ΅ΠΆΠ΄Ρƒ <body> ΠΈ </body> echo $fromBodyToBody; ?> 

Other sites takes, and this one does not. Tell me how to extract it from it?

  • I don `t know what is there and how it is with you, through my file_get_contents it draws with a bang - Zowie
  • from Denver, I, too, are pulling, but from a hosting server it gives out emptiness ... At first I pulled it and yesterday I stopped it ... - Only_fallen
  • And what is cut off - timeout? - karbachinsky
  • Not clear ... just does not print anything - Only_fallen

1 answer 1

Your content is in the $ result variable, just remove the output buffering functions

  • It helped, but not $ result, but $ content) - Only_fallen