At the beginning of a php file, I defined a variable $id, and use it in the rest of this file. I’m curious– How long this $id will last? Will it be accessible by other php files that loaded after?
At the beginning of a php file, I defined a variable $id , and
Share
Yes, this variable will be accessible by all files loaded after this file but within one execution of your PHP programme. If you would launch your PHP file in another browser, a different instance of this variable would be created for this other browser window.