需要替换的内容:{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
解决方案 »
- 我安装了nginx1.1.12和php5.3.5但是有phpinfo查看时,发现没有加载配置文件php.ini,实际上我这配置文件是存在信息显示的路径里面。
- 请教一下,用PHP如何生成50万个不重复的8位阿拉伯数字?
- 分层模式下数据库连接问题
- solaris 11中如何在没有安装mysql的机器上使用mysql_connect等函数
- 新手问个绑定数据的问题
- htttpclient 伪装代理
- PHP的session与cookie问题
- 大家看看我的php访问mysql的乱码问题!!要命了!!!
- 菜鸟求教,如何在liuxe系统下新建个文件或文件(如123.dat)!!
- 又有cookie的问题
- PDO怎样将结果集指针移动到指定的记录位置上啊
- 在win server上通过exec调用exe只能单进程么?不能并发调用吗?
echo preg_replace('/\{(\d+)_EXP\}/','<img src="http://localhost/images/$1.gif" />',$s);