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)); //取两字符之间的子字符串

        }
    }

猜你喜欢

转载自blog.csdn.net/Sunshine_366/article/details/82561315
今日推荐