php页面中,已知有很多url,把下面类型的url输出来
/default.aspx?tname=205\gc_text&hrefId=(*)     
(*)代表数字,如 /default.aspx?tname=205\gc_text&hrefId=2579   
这怎么实现呀,thanks

解决方案 »

  1.   

    preg_match_all('/\/default.aspx\?tname=205\\gc_text&hrefId=\d+/is', $string, $matches);
    print_r($matches);
      

  2.   

    $string='/default.aspx?tname=205\gc_text&hrefId=2579,/default.aspx?tname=205\gc_text&hrefId=200';
    preg_match_all('/\/default.aspx\?tname=205\\gc_text&hrefId=\d+/is', $string, $matches);
    print_r( $matches);
    没有得到呀,
      

  3.   

    修改了一下:
    <?php
    $string='/default.aspx?tname=205\gc_text&hrefId=2579,/default.aspx?tname=205\gc_text&hrefId=200';
    preg_match_all('/\/default\.aspx\?tname=205\\\\gc_text&hrefId=\d+/is', $string, $matches);
    print_r($matches);
    ?>