http_build_query

http_build_query

string http_build_query ( array formdata [, string numeric_prefix [, string arg_separator]] )

Is user to build a URL-encoded query string using an associative array
the array can be a single dimensional array or multidimensional .
If numeric index is provided then we can add prefix to numeric values

<?php

$arr = array(’s’=>’mode’,'q’=>’update’,'id’=>3);

echo http_build_query($data);

/// outputs s=mode&q=update&id=3
//// and

echo http_build_query($data,'’,'&’);

/// outputs s=mode&amp;q=update&ampid=3

$num_example = array(’first’,'update’,'log’);

echo http_build_query($num_example);
/// outputs 1=first&2=update&3=log
//// and
echo http_build_query($num_example,’val_’);
/// outputs val_1=first&val_2=update&val_3=log

?&;gt;

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.