I am passing the variable with dot in query string.Php is replacing the dot with under score. So how can i retain the variable name which is having dot in the name
h
The PHP developers implemented this in order to support register_globals() but if they'd paused for more than one second to consider the consequences then they would have only altered the names imported to the global variable namespace, not in $_POST itself. There's less than no reason for altering the request variables themselves... well, other than to make PHP incapable of handling standard form submissions.
Here's the solution for POST variables as well, which is probably trickier for more users than the GET solution:
function post_data(){
$data=explode('&',file_get_contents("php://input"));
$post=array();
foreach ($data as $var){
list($key,$value)=explode('=',$var,2);
$post[$key]=urldecode($value);
}
return $post;
}