我在这里需要正则表达式方面的帮助。
我希望 PHP 能够将字符串拆分为数组的各个部分,以便由 <%me %> 包围的子字符串将位于其自己的插槽中。
例如,
Hi there how are <%me date(); %> => {"Hi there how are ", "<%me date(); %>}
Hi there how are you<%me date(); %> => {"Hi there how are you", "<%me date(); %>}
Hi there how are you<%me date(); %>goood => {"Hi there how are you", "<%me date(); %>, "good"
Hi there how are you<%me date(); %> good => {"Hi there how are you", "<%me date(); %>}, " good"}
请注意,空格不会阻止标签被解析。