This article mainly introduces the usage of two-dimensional array of session in php, and describes the application techniques of two-dimensional array in session in the example form, which is of great practical value, for more information about how to use a two-dimensional session array in php, see the example in this article. Share it with you for your reference. The details are as follows:
The most common usage: a variable name
The code is as follows:
$ _ SESSION ['user'] = 0;
Echo $ _ SESSION ['user'];
Use arrays:
The code is as follows:
$ _ SESSION ['user'] ['A'] = 1;
$ _ SESSION ['user'] ['B'] = 2;
Echo $ _ SESSION ['user'] ['A'];
Echo $ _ SESSION ['user'] ['B'];
The advantage is that it can be grouped.
For example:
The code is as follows:
$ _ SESSION ['admin'] ['A'] = 11;
$ _ SESSION ['admin'] ['B'] = 22;
I hope this article will help you with PHP programming.