[Undefinedvariable] Notice: Undefinedvariable error prompt: Notice: & nbsp; Undefined & nbsp; variable: & nbsp; yan_zheng_shu & nbsp; in code: $ yan_zheng_shu & nbsp ;. & nbsp; dechex (mt_rand (1, & nbsp; 15); ". ", but the result is normal. [Undefined variable] Notice: Undefined variable
Error message: Notice: Undefined variable: yan_zheng_shu in
Code:
$yan_zheng_shu .= dechex(mt_rand(1, 15));
". =" Indicates an error, but the result is displayed normally. "+ =" indicates that "=" is okay.
What should I do? After php. ini is installed, the error prompt is disabled?
Or should I give it an empty character before ". =?
Or is "@" added before?
Which method is standardized?
Thank you.
------ Solution --------------------
This post was last edited by xuzuning at 09:40:09, January 24 ,.
Assign an initial value to $ yan_zheng_shu.
$ Yan_zheng_shu = '';
$ Yan_zheng_shu. = dechex (mt_rand (1, 15 ));
------ Solution --------------------
PHP does not need to declare variables,
However, an error at the E_NOTICE level will still be generated.
$yan_zheng_shu .= dechex(mt_rand(1, 15));
Equivalent
$yan_zheng_shu = $yan_zheng_shu . dechex(mt_rand(1, 15));
Obviously not defined
It is necessary to develop good habits.
------ Solution --------------------
Do you know the meaning of. =? the value assignment is from right to left, so this section certainly does not define the previous variable.