Php is used to save information to the current Session. php is used to save the current session. How php saves information to the current Session. php saves the current session. This article describes how php saves information to the current Session. Share it with you for your reference. The specific method is as follows: p php saves information to the current Session. php saves the current session.
This example describes how php saves information to the current Session. Share it with you for your reference. The details are as follows:
In php, you can use $ _ SESSION to save the session variable. the following code demonstrates the usage of $ _ SESSION.
<?php session_start(); print(""); $_SESSION["sitename"] = "W3M"; print("A value saved in the session named as sitename.\n"); $_SESSION["MyChoice"] = "red"; print("A value saved in the session named as MyChoice.\n"); echo $_SESSION['sitename']."\n"; echo $_SESSION['MyChoice]."\n"; print("\n");?>
The output result of the above code is as follows:
A value saved in the session named as MyLogin.A value saved in the session named as MyColor.W3Mred
I hope this article will help you with php programming.
Examples in this article describes how php saves information to the current Session. Share it with you for your reference. Details: p...