PHP 4.0 Bug #9211: URL and PHP Info/Options functions NEEDED
| From: | chris at returnzero dot com | Date: | Sun, 11 Feb 2001 16:00:57 +0000 |
| Subject: | PHP 4.0 Bug #9211: URL and PHP Info/Options functions NEEDED | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46370@lists.php.net to get a copy of this message | ||
From: chris@returnzero.com
Operating system: *
PHP version: 4.0.3pl1
PHP Bug Type: Feature/Change Request
Bug description: URL and PHP Info/Options functions NEEDED
parse_url() is a great function, but a counterpart to it would be even better.
Can we have a create_url() or create_query_string() function which would take an array of items and
build it using the local value of arg_separator ? A lot of users do NOT use arg_separator because
many programs are written with & as the separator (and there is little documentation about it).
Programmers should want to accomodate ALL users though and support those which use ";" or
"|" as the separator when writing programs designed to display URLs to get from page to
page of their application.
$base = "/search.php";
$qs = array ("action" => "search", "word" => "php");
echo create_url($base, $qs);
If the arg_separator is set to ";" the above script would output:
/search.php?action=search;word=php
Also, ini_get("arg_separator") and get_cfg_var("arg_separator") don't work
if it was set in .htaccess. Could we perchance also have get_master_cfg_value() and
get_local_cfg_value()? Those would help solve the problem above, though programmers would have to
write their own create_url() function to build urls with the arg_separator value.
All three of those should be supported by PHP natively IMHO.
--
Edit Bug report at: http://bugs.php.net/?id=9211&edit=1