|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-10-09 11:54 UTC] labs at undef dot name
Description: ------------ --- From manual page: http://www.php.net/function.http-build-query --- The php.ini file says: ; The separator used in PHP generated URLs to separate arguments. ; PHP's default setting is "&". ; http://php.net/arg-separator.output ; Example: ;arg_separator.output = "&" So "&" should the default setting, but the result of http_build_query() is with "&". $data = array( 'secret' => 'value_secret', 'response' => 'value_response', ); echo http_build_query($data) ."\n"; Results into "secret=value_secret&response=value_response" echo http_build_query($data, null, '&') ."\n"; Results into "secret=value_secret&response=value_response". Also the phpinfo() function output for "arg_separator.output" is "&" but is displayed in the generated HTML-Page as simple "&" which is confusing. This is also at the default php.ini settings at "arg_separator.input". -------- If i set "arg_separator.output" to "&" or '&' in the php.ini, then i also get "&" with http_build_query(). ini_get('arg_separator.output') also returns "&" then. Test script: --------------- $data = array( 'secret' => 'value_secret', 'response' => 'value_response', ); echo ini_get('arg_separator.output') ."\n"; echo http_build_query($data) ."\n"; echo http_build_query($data, null, '&') ."\n"; PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 23 01:00:01 2025 UTC |
No bug, it's a user fail. I re-tested it again and found this line in a included script: ini_set('arg_separator.output', '&'); So it's my fault, sorry for the waste of time!