开发者

how to decode something that is encoded with encodeUri()

开发者 https://www.devze.com 2023-03-26 10:11 出处:网络
If you encode something using javascript\'s encodeURI() method, how do yo get the decoded string in PHP?

If you encode something using javascript's encodeURI() method, how do yo get the decoded string in PHP?

I have string name= "salman mahmood" which I'm sending via POST message to my server. When I alert() the string at client side it gives me "salman%20mahmood" after encoding. At server side I'm decoding it using urldecode() but the result I'm getting is "salman". Do I need a different method to decode? the rawurldecode isnt working either; I just need the value with the space restored back.

Edit: thanks every one for the suggestions but im writing the code as follows and it still doesnt work!!

<input开发者_如何转开发 type="text" id="chapterNumber" value=<?php echo rawurldecode("chapter%20Two"); ?> disabled="disabled"> 

it only prints "chapter"


Put it into quotes ' '

<input type="text" id="chapterNumber" value='<?php echo rawurldecode("chapter%20Two"); ?>'disabled="disabled"> 
0

精彩评论

暂无评论...
验证码 换一张
取 消