开发者

+1234567 ends up being 1234567... where is the plus?

开发者 https://www.devze.com 2023-01-06 22:09 出处:网络
Well through jquery i am doing an ajax request to send through a cell开发者_JAVA技巧 number in the format of +1234567 but if i access it on the other end using $_POST[\'cell\']; the plus is gone, wher

Well through jquery i am doing an ajax request to send through a cell开发者_JAVA技巧 number in the format of +1234567 but if i access it on the other end using $_POST['cell']; the plus is gone, where could it be?


This depends on how you are performing the query.

If you do:

$.ajax({
    url: 'foo.php',
    data: 'cell=+1234567'
});

You will loose the + because it because it has to be URL encoded (+ means space in the URL). I would recommend you this which will take care of encoding:

$.ajax({
    url: 'foo.php',
    data: { cell: '+12345' }
});
0

精彩评论

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