$str = " hello world  asdafsd ni hao ";
如上字符串,请分离出字符串中所有的**对,谢谢

解决方案 »

  1.   

    不好意思 发的帖子字符让给屏蔽了 $str = "hello worldasdfasdni hao"
    //分离这些..对
      

  2.   


    $str = "hello worldasdfasdni hao";preg_match_all('/\[b\](.*?)\[\/b\]/is', $str, $match);
    print_r($match[1]);
      

  3.   

    preg_match_all('~\[b\](.*?)\[/b\]~is',$str,$data);
      

  4.   

    <?php 
    $str = "hello worldasdfasdni hao";
    preg_match_all('/\[b\]([^\[\]]*)\[\/b\]/is', $str, $matches);
    print_r($matches[1]);
    ?>