Answers for "construct url php"

PHP
3

php http build query

$data = [
    'foo' => 'bar',
    'baz' => 'boom',
    'cow' => 'milk',
    'php' => 'hypertext processor'
];

echo http_build_query($data); // output: foo=bar&baz=boom&cow=milk&php=hypertext+processor

echo http_build_query($data, '', '&'); // output: foo=bar&baz=boom&cow=milk&php=hypertext+processor
Posted by: Guest on May-01-2020

Browse Popular Code Answers by Language