试图在我的内容中找到"\ ["不会得到任何结果.我使用这种模式:
preg_replace('/\\\[/', $content, $matches);
Run Code Online (Sandbox Code Playgroud)
我的模式出了什么问题?谢谢.
更新.我的意思是我的错preg_match_all.
preg_replace正在替换所有找到的匹配.使用preg_match的第一场比赛,并preg_match_all获得所有的比赛,而不是:
preg_match_all('/\\\[/', $content, $matches);
Run Code Online (Sandbox Code Playgroud)