The example in the video I watched today does not understand this. 1. The $ I of the for loop condition statement below does not appear at all. what is the use of this condition?
2. there is also a small dot in front of the equal sign. I don't know why. The video says it makes sense to let it Add itself.
Thanks for the two questions.
For ($ I = 0; $ I <4; $ I ++)
{
$ Nmsg. = dechex (mt_rand (0, 15 ));
}
Reply to discussion (solution)
For ($ I = 0; $ I <4; $ I ++) {$ nmsg. = dechex (mt_rand (0, 15 ));}
The code above indicates that a 10-digit number is randomly generated from 0 to 15, and then converted to hexadecimal. A total of four loops are generated ($ I is used to control the number of loops). Each hexadecimal number is connected by a "point" (a point is used to connect a string ). The final $ nmsg result is a string consisting of four hexadecimal numbers.
For ($ I = 0; $ I <4; $ I ++) {$ nmsg. = dechex (mt_rand (0, 15 ));}
The code above indicates that a 10-digit number is randomly generated from 0 to 15, and then converted to hexadecimal. A total of four loops are generated ($ I is used to control the number of loops). Each hexadecimal number is connected by a "point" (a point is used to connect a string ). The final $ nmsg result is a string consisting of four hexadecimal numbers.
Thank you.