I’d like to know why the dot is replaced by an underscore during this manipulation :
$s = http_build_query([ "!~.var" => "", ]); $a = parse_str($s, $r); echo $s; print_r($r);
prints :
%21%7E.var= Array ( [!~_var] => )
Advertisement
Answer
parse_str()
— Parses the string into variables
Variables do not allow having dots inside their name.
$hello.world = 'hello world';
<– would be illegal.
$hello_world = 'hello world';
<– is legal