<?php
// if your url is http://link?var=value
if (isset($_GET['var'])) // works with request
$var = $_GET['var'];
echo $var;
// output value
<a href="index.php?id=<?php echo $my_id;?>&name=<?php echo $my_name;?>Click</a>
<?php
$id = intval($_GET['id']); // integer value
$name = strval($_GET['name']); // string value
?>
<?php
$parameter1 = isset($_GET['parameter1']) ? $_GET['parameter1'] : null;
<?php
function foo()
{
$numargs = func_num_args();
echo "Number of arguments: $numargs
";
if ($numargs >= 2) {
echo "Second argument is: " . func_get_arg(1) . "
";
}
$arg_list = func_get_args();
for ($i = 0; $i < $numargs; $i++) {
echo "Argument $i is: " . $arg_list[$i] . "
";
}
}
foo(1, 2, 3);
?>