|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-30 02:53 UTC] derick@php.net
[2002-01-30 04:52 UTC] brubla at seznam dot cz
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Global variable will be registered in session only first time. When you will be refreshing page with following code, it will count only to 2. <?php session_start(); global $counter; //when you remove this row, all will work properly session_register("counter"); $counter++; echo $counter; ?> When you remove row with "global $counter;" page will count to 3, 4, 5... Both variants of code works properly with PHP 4.0.6 (on Windows 2000).