Skip to content
PHP Logo

How does the configuration of arg_separator.input and arg_separator.output in PHP.ini affect URL parameter handling in PHP?

The configuration of arg_separator.input and arg_separator.output in PHP.ini affects how PHP interprets URL parameters. By default, arg_separator.input is set to "&" and arg_separator.output is set to "&", which means that PHP expects URL parameters to be separated by "&" in both input and output. If your application receives URL parameters separated by a different character, you can adjust these settings in PHP.ini to match the expected separator.

php
// Set arg_separator.input and arg_separator.output in PHP.ini to match the separator used in URL parameters
ini_set('arg_separator.input', '&');
ini_set('arg_separator.output', '&');