1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <?php
if(isset($_GET['param'])){
{
if ($_GET['cas']<3)
var_dump($_GET['param']);
else var_dump(explode(',',$_GET['param']));
}
}
$nb = 123;
$st = 'abc';
$tab = array(1,2,3);
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<title>Types</title>
</head>
<body>
<p><a href="?param=<?php echo $nb; ?>&cas=1">Passer un nombre</a></p>
<p><a href="?param=<?php echo $st; ?>&cas=2">Passer une chaine</a></p>
<p><a href="?param=<?php echo implode($tab); ?>&cas=3">Passer un tableau</a></p>
</body>
</html> |