When the php variable is used in the html tag, the prompt is Undefinedindex: uidinvarwwwlist. php, list. the specific php code is as follows: {code ...} when the php variable is used in the html tag, the following error occurs: Undefined index: uid in/var/www // list. php
, The specific code of list. php is as follows:
Get ("userid"); $ I ++) {$ data [] = $ redis-> hgetall ("user :". $ I);}/* var_dump ($ data) result: array (size = 3) 0 => array (size = 0) empty 1 => array (size = 4) 'uid' => string '1' (length = 1) 'username' => string 'jjj '(length = 3) 'password' => string '200' (length = 3) 'age' => string '20' (length = 2) 2 => array (size = 4) 'uid' => string '2' (length = 1) 'username' => string 'lamp '(length = 4) 'password' => strin G'100' (length = 3) 'age' => string '20' (length = 2) */?>
User list
| Uid |
Username |
Age |
|
|
|
|
Reply content:
When the php variable is used in the html tag, the following error occurs: Undefined index: uid in/var/www // list. php.
, The specific code of list. php is as follows:
Get ("userid"); $ I ++) {$ data [] = $ redis-> hgetall ("user :". $ I);}/* var_dump ($ data) result: array (size = 3) 0 => array (size = 0) empty 1 => array (size = 4) 'uid' => string '1' (length = 1) 'username' => string 'jjj '(length = 3) 'password' => string '200' (length = 3) 'age' => string '20' (length = 2) 2 => array (size = 4) 'uid' => string '2' (length = 1) 'username' => string 'lamp '(length = 4) 'password' => strin G'100' (length = 3) 'age' => string '20' (length = 2) */?>
User list
| Uid |
Username |
Age |
|
|
|
|
Is it okay for isset before echo?
The first child element of your array is empty. the uid cannot be found.
In most cases, it is important to note that the fault tolerance mechanism should be well implemented.