Hi all,
I found a nice piece of code on php.net.
It works well, but I do not understand all of this
Can anyone tell me what happens exactly in
(!mt_rand(0,2)?
mt_rand(48,57)
!mt_rand(0,1)?mt_rand(65,90):mt_rand
(97,122)))
I am aware of the function of mt_rand, but do not understand this code :-(
JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
I found a nice piece of code on php.net.
It works well, but I do not understand all of this
Code:
for($len=10,$r='';strlen($r)<$len;$r.=chr(!mt_rand(0,2)?
mt_rand(48,57):(!mt_rand(0,1)?mt_rand(65,90):mt_rand
(97,122))));
Can anyone tell me what happens exactly in
(!mt_rand(0,2)?
mt_rand(48,57)

(97,122)))
I am aware of the function of mt_rand, but do not understand this code :-(
JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!