怎么用php把这个值得到

解决方案 »

  1.   

    有幾種方法:
    1.用正則
    2.根據開始和結束位置用substr函數
      

  2.   

    我有个程序是取出[aa]中间的aa,用了下面的代码,你参考一下
    preg_match("/^([^\[]+)?([^\]]+)/i",$String,$matches);
    echo trim(substr($matches[2],1,strlen($matches[2])));
      

  3.   

    $str="<33>";
    $str{0}='';
    $str{strlen($str)-1}='';
      

  4.   

    lz是再说xml还是就是普通的string
      

  5.   

    如果你所有这个模式里边都是数字的话 :
    preg_match('/<([0-9]+)>/si',你的字符串,$matches)
    $matches[0] :<33>
    $matches[1] :33