Program – How to build a Query String in PHP? Sometime you need to construct a link that includes name/value pair in a query string here is a example.
Solution – Build a Query String in PHP
<?php $var = array('name'=>'hindialerts.com', 'type'=>'website', 'content'=>'php tutorials'); $query_string = http_build_query($var); $url = 'https://www.google.com/search?q='.$query_string; echo $url; ?>