php提取两个字符之间子字符串

//对"功能码[0001] 公共地址[0002]"字符串 取子串

 public function func_process($content) {
        $str = substr($content, 0, 9); //取子串 取两字符之间的子字符串
        if($str == "功能码") {
      $func = substr($content, strlen("[")+strpos($content, "["), (strlen($content)-strpos($content, "]"))*(-1)); //取两字符之间的子字符串

        }
    }

 

你可能感兴趣的:(php)