You are here: Re: [PHP] re-setting all cookies « PHP « IT news, forums, messages
Re: [PHP] re-setting all cookies

Posted by Ken on 10/04/29 11:11

/*From the php manual
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
$value = $value * 2;
}
*/

$_COOKIE is a variable... but you need the key for setcookie(). so you can do:

foreach($_COOKIE as $key => $value){
setcookie("$key","", time()-3600);
}

i know there is the $value bit that we never use, but this is the
simplest form I can think of. can anyone else think of something
better?

HTH :D

On Tue, 22 Mar 2005 08:39:45 -0000, AndreaD
<andrea.davidson@silene.co.uk> wrote:
> I want a button that resets all my cookies. Can I reset them all with a
> foreach command?
>
> AD
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация