<div id=\csuid3_wpcpcd\ class=\wpcpdCSS\ style="">里面那个style=""怎么用正则匹配啊

解决方案 »

  1.   

    preg_match('/style="([^"]*+)"/is', $str, $matches);
      

  2.   

    $chenrui=file_get_contents("http://wenda.tianya.cn/wenda/thread?tid=37dc202581df20e4&clk=cts_ht");
    preg_match('/id=\csuid3_wpcpcd\ class=\wpcpdCSS\ style="([^"]*+)"/is', $chenrui, $matches);
    print_r($matches);
    获取不到内容啊,空的
      

  3.   

    $chenrui=file_get_contents("http://wenda.tianya.cn/wenda/thread?tid=37dc202581df20e4&clk=cts_ht"); 
    preg_match_all('#(style=)\"[^"]*\"#', $chenrui, $matches,PREG_PATTERN_ORDER); 
    print_r($matches);   
      试试
      

  4.   

    <div id=csuid3_wpcpcd class=wpcpdCSS style=""> 
    注意看,style里面的内容为空
      

  5.   

    能不能说詳細一下情况, 只要获得style=""里的内容?  不管什么输出什么 ?