如何在string
上制作多个preg_match
。我做了一项研究,并能够提出以下解决方案。如何制作多个preg_macth
<?php
$input = '@[email protected] & Good Day ~World~';
$regex = '/
~
(.*?)
~
/six';
$input_new = preg_replace($regex,'<i>$1</i>', $input);
echo $input_new;
以上将搜索(~)string(~)
并更改为斜体格式。我想如何搜索(@)string(@)
并更改为加粗格式在同一文本上。
现在你将一个字符串传递给第一个和第二个p arameter。查看手册中的'preg_replace()',看看还有什么可以作为第一个和第二个参数。 – Rizier123