Posted by Skeleton Man on 01/05/07 05:05
>How would i do this in php ? (from borland c++)
> for (int i=1; i<=myString.Length(); ++i)
> {
> returnValue += StrToInt(AnsiString("0x" +
>(AnsiString)myString[i]));
> }
Try something like this:
<?
$returnValue = 0;
$myString = 'ABCDEF';
for ($i=1;$i<=strlen($myString);$i++)
{
$returnValue += hexdec($myString[$i]);
}
echo $returnValue;
?>
Regards,
Chris
[Back to original message]
|