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

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

WBOY
Release: 2016-06-23 13:58:51
Original
977 people have browsed it

[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';$ar = preg_split('/\[[A-Z]\]/', $s);
Copy after login

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