Etiket arşivi: Hypertext Processor

http_build_query

<?php
$data = array('foo', 'bar', 'baz', 'boom',
              'cow' => 'milk',
              'php' =>'hypertext processor');

echo http_build_query($data) . "\n";
echo http_build_query($data, 'myvar_');
?>
<?php
$data = array('foo'=>'bar',
              'baz'=>'boom',
              'cow'=>'milk',
              'php'=>'hypertext processor');

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

?>
0=foo&1=bar&2=baz&3=boom&cow=milk&php=hypertext+processor
myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&cow=milk&php=hypertext+processor