mirror of
https://github.com/php/php-src.git
synced 2024-10-01 06:46:08 +00:00
28 lines
1.0 KiB
PHP
28 lines
1.0 KiB
PHP
--TEST--
|
|
Test http_build_query() function: usage variations - testing four parameter added in PHP 5.4.0
|
|
--CREDITS--
|
|
Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com>
|
|
--SKIPIF--
|
|
<?php
|
|
if (version_compare(PHP_VERSION, '5.4.0', '<')) die("skip this test if PHP_VERSION is less than 5.4.0");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
/* Prototype : string http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] )
|
|
* Description: Generates a URL-encoded query string from the associative (or indexed) array provided.
|
|
* Source code: ext/standard/http.c
|
|
*/
|
|
|
|
$oDimensional = array(
|
|
"name" => "main page",
|
|
"sort" => "desc,admin",
|
|
"equation" => "10 + 10 - 5"
|
|
);
|
|
|
|
echo http_build_query($oDimensional, '', ini_get('arg_separator.output'), PHP_QUERY_RFC1738) . PHP_EOL;
|
|
echo http_build_query($oDimensional, '', ini_get('arg_separator.output'), PHP_QUERY_RFC3986);
|
|
?>
|
|
--EXPECTF--
|
|
name=main+page&sort=desc%2Cadmin&equation=10+%2B+10+-+5
|
|
name=main%20page&sort=desc%2Cadmin&equation=10%20%2B%2010%20-%205
|