PHP
需要替换的内容:{1_EXP}{2_EXP}{3_EXP}{4_EXP}{5_EXP}{5_EXP}...
需要替换成:
例如:
{0_EXP} =
{1_EXP} =
{2_EXP} =
...
PHP:
$row['msg'] = str_replace(表达式, '
', $mycn['msg']);
什么写?还有其他更好的方法不?
回复讨论(解决方案)
$s='{1_EXP}{2_EXP}{3_EXP}{4_EXP}{5_EXP}{5_EXP}';echo preg_replace('/\{(\d+)_EXP\}/','<img src="http://localhost/images/$1.gif" / alt="PHP 批量替换内容" >',$s);
Statement: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