john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

php query string example john pfeiffer

php-query-string-example-john-pfeiffer


To get the current QUERY_STRING, you may use the variable $_SERVER['QUERY_STRING']

<?php
$str = "first=value&arr[]=foo+bar&arr[]=baz";
parse_str($str);
echo $first;  // value
echo $arr[0]; // foo bar
echo $arr[1]; // baz

parse_str($str, $output);
echo $output['first'];  // value
echo $output['arr'][0]; // foo bar
echo $output['arr'][1]; // baz

?>


http://uk.php.net/manual/en/language.variables.external.php



<?php
    echo("<pre>\n");
    print_r($_GET);
    echo("</pre>\n");
?>

foreach($_GET as $keyname => $value) {
echo("$keyname --&gt; $value.<br />\n");
}


$_REQUEST array

the 'invisible' $_POST querystring variables

  • « php radio buttons
  • web log files analysis webalizer »

Published

Feb 6, 2010

Category

php

~60 words

Tags

  • example 36
  • john 2
  • pfeiffer 1
  • php 82
  • query 7
  • string 18