cvs: /phpdoc/functions http.sgml

From: Date: Mon, 15 Nov 1999 01:44:24 +0000
Subject: cvs: /phpdoc/functions http.sgml
Groups: php.dev 
Request: Send a blank email to php-dev+get-12546@lists.php.net to get a copy of this message
cslawi Sun Nov 14 20:44:24 1999 EDT Modified files: /phpdoc/functions http.sgml Log: Added note about cookies using array syntax. Index: phpdoc/functions/http.sgml diff -u phpdoc/functions/http.sgml:1.7 phpdoc/functions/http.sgml:1.8 --- phpdoc/functions/http.sgml:1.7 Sun Nov 14 20:37:07 1999 +++ phpdoc/functions/http.sgml Sun Nov 14 20:44:24 1999 @@ -124,6 +124,27 @@ echo $HTTP_COOKIE_VARS["TestCookie"]; </programlisting></informalexample></para> + <para> + You may also set array cookies by using array notation in the + cookie name. This has the effect of setting as many cookies as + you have array elements, but when the cookie is received by your + script, the values are all placed in an array with the cookie's + name: + <informalexample> + <programlisting role="php"> +setcookie( "cookie[three]", "cookiethree" ); +setcookie( "cookie[two]", "cookietwo" ); +setcookie( "cookie[one]", "cookieone" ); +if ( isset( $cookie ) ) { + while( list( $name, $value ) = each( $cookie ) ) { + echo "$name == $value&lt;br&gt;\n"; + } +} + </programlisting> + </informalexample> + + </para> + <para> For more information on cookies, see Netscape's cookie specification at <ulink url="&spec.cookies;">&spec.cookies;</ulink>.</para>

« previous php.dev (#12546) next »