0

I create a php file containing the following codes:

<?php
print_r ($_GET);
?>

And I make a request from browser:

http://localhost/Study/php/get.php?test=1,+

I got the following message:

Array ( [test] => 1, )

the plus "+" is missing, but when i use minus "-" instead of plus "+" it's ok.

http://localhost/Study/php/get.php?test=1,-

generate the following message:

Array ( [test] => 1,- )

I use lighttpd with php.

jz1108
  • 1,300
  • 1
  • 11
  • 14

1 Answers1

2

The plus sign is a special character in urls: It represents a space. Use the appropriate variant that uses url encoding:

http://localhost/Study/php/get.php?test=1,%2B
matthias
  • 2,255
  • 1
  • 23
  • 28