/ Published in: PHP

Transform $_GET or $_POST in a string to add to an URL and send variables and values.
Argument: Receive an $_GET O $_POST array function.
Returns: variables concatenation to add to the URL.
Argument: Receive an $_GET O $_POST array function.
Returns: variables concatenation to add to the URL.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getVars($arrVars){ $txtGetVars=''; foreach ($arrVars as $Key=>$Value){ $txtGetVars .= ($txtGetVars=='')? $Key.'[]='$arrVars[$Key][$k] :'&'.$Key.'[]='.$arrVars[$Key][$k]; } else{ $txtGetVars .=($txtGetVars=='')? $Key.'='.$Value :'&'.$Key.'='.$Value ; } } } return $txtGetVars; }
Comments
