i use PHP file to send data from my web to JS. And i sending data to php by URL. For xample. www.web.com/send.php?data=Hello everybody. And my problem is, if someone send special character or emoticon, PHP script wont work. Is there any function to encode string to string only with letters and numbers, and on PHP side decode it? Thanks, for replyes ;).
3条回答 默认 最新
- dongou0524 2014-12-23 16:52关注
In javascript use:
encodeURIComponent('Hello everybody')
In PHP use:
$data=$_GET['data'];
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报