将&符号(& amp;)解码为正常 [英] Decoding ampersand (&amp) to normal

查看:5861
本文介绍了将&符号(& amp;)解码为正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建添加文件表单时遇到了问题,如果用户想要,它会在提交添加新文件后重定向,但是当我尝试这样做时,它仍然会重定向回m =文件,因为它显示? M =文件&放大器;放大器; A = addedit 。我尝试使用html_entity_decode,但它仍然显示相同的?m = files& amp; a = addedit 该怎么做,这里是我的重定向?

I am having problems creating add file form which if person wants, it redirects after submit to add new file, but when I try to do that it still redirects back to m=files because it shows ?m=files&a=addedit. I tried using html_entity_decode, but still it shows the same ?m=files&a=addedit what to do, here is my redirect?

<input type="hidden" name="redirect" value="<?php echo $new = html_entity_decode('m=files&amp;a=addedit'); ?>" />


推荐答案

& amp & 应该可以解决问题,我想。

Not 100% sure what OP wants, but simply replacing &amp with & should solve the problem, I think.

<input type="hidden" name="redirect" value="<?php echo str_replace('&amp;', '&', 'm=files&amp;a=addedit'); ?>" />

这篇关于将&符号(&amp; amp;)解码为正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆