用正则表达式。preg_match、preg_grep……等函数。

解决方案 »

  1.   

    正宗的应是ajax当然你用正则或截取或用DOM取都行
      

  2.   

    我还是说个例子吧,例如,
     
    我要截取http://www.google.cn/search?&q=1usd%3D%3Frmb 这个网站里面的实时汇率,请问怎么写?
    我试着用 
    preg_match_all("1美元 = .* 人民币",$content, $content);
    echo $content[0][0];但是根本取不出来。求救!
      

  3.   

    不好意思,上面手误,代码是这样
    $url="http://www.google.cn/search?&q=1usd%3D%3Frmb";
    $content=file_get_contents($url);
    preg_match_all( "1美元   =   .*   人民币 ",$content,   $title); 
    echo   $title[0][0]; 页面能取到了,但是汇率数值还是取不出来,是不是正则表达式写得不对?