Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有带有参数的字符串,例如
“你好,%{user}。请给%{client}一把刀”。
所以,拜托,我不熟悉正则表达式,我需要有可以从字符串中获取参数列表的 php 构造。请帮帮我,我希望你能。谢谢你。
$str = "Hello, %{user}. Please, give %{client} a knife". preg_match_all("/%\{(.*?)\}/", $str, $matches); print_r($matches);