Don't know how many of you know about this function but it's beautiful.
http_build_query();
Basically you pass it a hash of field=>value and it does the urlencoding and generatres a nice post string. For example:
<?
$myarray = array('field1'=>'value1','field2'=>'value2');
$poststring = http_build_query($myarray);
echo $poststring;
?>
and you'll get the output:
field1=value1&field2=value2
That's a very simple one but I coded for a few years before I found this function. Works great and is a internal PHP fuction so you know it's fast and doesn't have bugs.
enjoy!
http_build_query();
Basically you pass it a hash of field=>value and it does the urlencoding and generatres a nice post string. For example:
<?
$myarray = array('field1'=>'value1','field2'=>'value2');
$poststring = http_build_query($myarray);
echo $poststring;
?>
and you'll get the output:
field1=value1&field2=value2
That's a very simple one but I coded for a few years before I found this function. Works great and is a internal PHP fuction so you know it's fast and doesn't have bugs.
enjoy!