Hey, I'm trying to figure out how
$arrMD5Chars="a4cd31g";
foreach ($arrMD5Chars as $value) //for each value in arrMD5Chars, given the value $value
{
$intTotal += '0x0'.$value;
}
creates the value $intTotal. Specifically, what does the "'0x0'.$value" mean?
Mysterious Code
Moderator: General Moderators
Re: Mysterious Code
It doesn't. foreach() doesn't iterate through strings.
http://us2.php.net/manual/en/control-st ... oreach.php
http://us2.php.net/manual/en/control-st ... oreach.php
Re: Mysterious Code
You could turn it into an array if you really wanted to...
Code: Select all
$arrMD5Chars=str_split("a4cd31g");
foreach ($arrMD5Chars as $value) {
$intTotal += '0x0'.$value;
}Re: Mysterious Code
Okay, so $arrMD5Chars is an array that contains characters like ['a', 'b', '3', 'z', etc...]. $intTotal starts of equal to zero. What would the line "$intTotal += '0x0'.$value;" accomplish?