Posted By

adampatterson on 05/08/10


Tagged

url String query


Versions (?)

Generate URL-encoded query string


 / Published in: PHP
 

URL: http://uk2.php.net/http_build_query

  1. <?php
  2. $data = array('foo'=>'bar',
  3. 'baz'=>'boom',
  4. 'cow'=>'milk',
  5. 'php'=>'hypertext processor');
  6.  
  7. echo http_build_query($data); // foo=bar&baz=boom&cow=milk&php=hypertext+processor
  8. echo http_build_query($data, '', '&amp;'); // foo=bar&amp;baz=boom&amp;cow=milk&amp;php=hypertext+processor
  9.  
  10. ?>

Report this snippet  

You need to login to post a comment.