I wrote a script for parser soaps:

<? $handler=fopen('javabitz.txt','a+'); for($i=1;$i<3000;$i++){ //парсим от 1 до 3000 $filename = 'http://www.***.ru/scr.php?num='.$i; echo $i.". "; $str = file_get_contents($filename); preg_match_all('|href="mailto:([^"]*)"|is',$str,$out); if(empty($out[1][0])) echo "Нету мыла"; else{ echo " get ".$out[1][0]; fwrite($handler,$out[1][0]."\n"); } echo "\n"; } fclose($handler); ?> 

How to make it so that we parse from the <body> to </body> in preg_match_all .

Thank you in advance :)



    2 answers 2

     preg_match_all('/<body[^>]*>(.*)<\/body>/', str_replace("\n", '', $str), $out); // результат в $out[1][0] 
    • thanks) your decision helped - ikerya
     "|\<body\>href="mailto:([^"]*)\<\/body\>|" 

    it seems so...

    • only href = "mailto: there is too much .. here if without it .. like this:" | <body> ([^ "] *) </ body> |" - JavaBitz