Skip to content
Advertisement

Dot replaced by underscore while building query string from array

I’d like to know why the dot is replaced by an underscore during this manipulation :

JavaScript

prints :

JavaScript

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

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement