extract info from another web page

前端 未结 2 986
借酒劲吻你
借酒劲吻你 2021-01-24 10:46

I have this test.php where i have this info :

callername1 : \'Fernando Verdasco1\'
callername2 : \'Fernando Verdasco2\'
callername3 : \'Fernando Verdasco3\'
call         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-24 11:31

    There is a rather simple approach to tihs:

    $fData = file_get_contents("test.php");
    $lines = explode("\n", $fData);
    foreach($lines as $line) {
        $t = explode(":", $line);
    
        echo trim($t[1]); // This will give you the name
    }
    

提交回复
热议问题