ASCII To Decimal

This algorithm converts ASCII code to decimal numbers.



									function ASCIIToDecimal($str)
{
	$dec = "";
	$strLen = strlen($str);

	for ($i = 0; $i < $strLen; $i++)
	{
		$cDec = strval(ord($str[$i]));

		if (strlen($cDec) < 3)
			$cDec = str_pad($cDec, 3, "0", STR_PAD_LEFT);

		$dec .= $cDec;
	}

	return $dec;
}
								


Example

									$data = "Programming Algorithms";
$value = ASCIIToDecimal($data);
								


Output

									080114111103114097109109105110103032065108103111114105116104109115