本帖最后由 sbsbv 于 2012-06-19 18:54:52 编辑

解决方案 »

  1.   

    preg_match('/开始(.*)结束/s',$con,$m);
    echo $m[1];
      

  2.   

    [User:root Time:07:54:42 Path:/home/liangdong/php]$ php preg.php 什么都的,乱码患难夫妻,标签#·¥¥%#¥·¥%#%·#《》<a>·#《》</a><div>yytt</div><li>></li>
    dsffffffffffffffffffffrrrrrrrrrrrrrrrtttttttttttttt
    [User:root Time:07:54:42 Path:/home/liangdong/php]$ cat preg.php 
    <?php
    $content = <<<EOF
    <html>
    eeeeeeeee
    <a>开始</a>
    什么都的,乱码患难夫妻,标签#·¥¥%#¥·¥%#%·#《》<a>·#《》</a><div>yytt</div><li>></li>
    dsffffffffffffffffffffrrrrrrrrrrrrrrrtttttttttttttt
    <a>结束</a>";
    </html>
    EOF;
    $nmatches = preg_match('/<a>开始<\/a>(.*)<a>结束<\/a>/iUs', $content, $matches);
    print_r($matches[1]);
    ?>