Home > Backend Development > PHP Tutorial > 关于PHP正则匹配有关问题.求教

关于PHP正则匹配有关问题.求教

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:54:58
Original
912 people have browsed it

关于PHP正则匹配问题...求教!
[Q]谢谢大大们的无私帮助谢谢你们了(     )[A]谢谢[B]非常感谢[C]十分感谢[D]万分感谢[E]十万分感谢[F]百万分感谢[K]D

对于上述字串如何用正则将[Q]、[A]、[B]、[C]、[D]、[E]、[F]、[K]剔除出来,将剩余字串组合成数组,求教各位大大!
------解决方案--------------------

$s = '$Q]谢谢大大们的无私帮助谢谢你们了(     )[A]谢谢[B]非常感谢[C]十分感谢[D]万分感谢[E]十万分感谢[F]百万分感谢[K]D';<br />$ar = preg_split('/\[[A-Z]\]/', $s);<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template