Example 5-4. SetCookie Example (设置Cookie的例子) $Count++; SetCookie ("Count", $Count, time()+3600); SetCookie ("Cart[$Count]", $item, time()+3600);
环境变量 PHP自动的使用环境变量作为PHP的普通变量,例子如下。 echo $HOME; /* Shows the HOME environment variable, if set. */ 既然信息随同GET,Post,Cookie等机制被传递进来,并且自动创建了PHP变量,有时最好是准确的从外界环境中读出一个变量以确信你正在使用正确的版本。getenv()函数就是做这个工作的,你也可以使用putenv()函数来设置一个环境变量。
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn