需要替换的内容:{1_EXP}{2_EXP}{3_EXP}{4_EXP}{5_EXP}{5_EXP}...需要替换成:<img src="http://localhost/images/*.gif" />例如:
{0_EXP} = <img src="http://localhost/images/0.gif" />
{1_EXP} = <img src="http://localhost/images/1.gif" />
{2_EXP} = <img src="http://localhost/images/2.gif" />
...PHP:
$row['msg'] = str_replace(表达式, '<img src="http://localhost/images/当前名称.gif" />', $mycn['msg']);什么写?还有其他更好的方法不?
PHP
{0_EXP} = <img src="http://localhost/images/0.gif" />
{1_EXP} = <img src="http://localhost/images/1.gif" />
{2_EXP} = <img src="http://localhost/images/2.gif" />
...PHP:
$row['msg'] = str_replace(表达式, '<img src="http://localhost/images/当前名称.gif" />', $mycn['msg']);什么写?还有其他更好的方法不?
PHP
解决方案 »
- 如何分组查询并现实结果?
- html_entity_decode和htmlspecialchars_decode的区别?
- 合并3个变量,高手帮忙下,谢了
- 数组+数组会是什么结果?
- CURL模拟POST传递参数问题
- js 怎么取得html 中控件坐标
- 有哪位高手知道用PHP输出图片为HTML编码?
- $str="这是$a"; $a="杯子";print $str;这样的顺序,有没有办法输出:这是杯子?
- php 4.4下怎么才能支持gd?
- 在Windows2000上为什么不能登录?
- PDO怎样将结果集指针移动到指定的记录位置上啊
- 在win server上通过exec调用exe只能单进程么?不能并发调用吗?
echo preg_replace('/\{(\d+)_EXP\}/','<img src="http://localhost/images/$1.gif" />',$s);