我想解析一个字符串以获取方括号标签内的值:
[vc_column_text][/vc_column_text]
我preg_match_all()在 PHP 中使用
$string = '[vc_row][vc_column][/vc_column][/vc_row][vc_row][vc_column width="1/2"][vc_column_text css=".vc_custom_1576642149231{margin-bottom: 0px !important;}"]This is the string I want to fetch[/vc_column_text][/vc_column][/vc_row]`;我试过这个:
preg_match_all("'[vc_column_text(.*?)](.*?)[/vc_column_text]'", $string, $matches);但这只会返回一个 2-3 个字符的数组:

非常感谢您的帮助:)
临摹微笑
明月笑刀无情
随时随地看视频慕课网APP