From 25affde9f0d5d462b0cd5cac783ae77bfc5bf67b Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Mon, 20 Jan 2003 18:43:40 +0000 Subject: [PATCH] Expand the examples a little, also not rely on register_globals. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@112821 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/http/functions/setcookie.xml | 37 +++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/reference/http/functions/setcookie.xml b/reference/http/functions/setcookie.xml index 99bb343cd4..c65c6ee9cb 100644 --- a/reference/http/functions/setcookie.xml +++ b/reference/http/functions/setcookie.xml @@ -1,5 +1,5 @@ - + @@ -95,9 +95,13 @@ <function>setcookie</function> send examples ]]> @@ -110,9 +114,11 @@ setcookie ("TestCookie", $value,time()+3600, "/~rasmus/", ".utoronto.ca", 1); <function>setcookie</function> delete examples ]]> @@ -126,8 +132,14 @@ setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", ".utoronto.ca", 1); ]]> @@ -141,14 +153,27 @@ echo $_COOKIE["TestCookie"]; \n"; + +// after the page reloads, print them out +if (isset($_COOKIE['cookie'])) { + foreach ($_COOKIE['cookie'] as $name => $value) { + echo "$name : $value
\n"; } } + +/* which prints + +three : cookiethree +two : cookietwo +one : cookieone + +*/ +?> ]]>