Return to Snippet

Revision: 9763
at November 21, 2008 10:03 by luizlopes


Updated Code
function string_to_ascii($string)
{
    $ascii = NULL;
	
    for ($i = 0; $i < strlen($string); $i++) 
    { 
    	$ascii += ord($string[$i]); 
    }
    
    return($ascii);
}

Revision: 9762
at November 20, 2008 18:02 by luizlopes


Initial Code
for ($i = 0; $i < strlen($string); $i++) { echo ord($string[$i]); }

Initial URL
http://twitter.com/jfanaian/statuses/1015463286

Initial Description
My friend Jamal Fanaian showed me how to convert a string to its' ASCII value.

Initial Title
Convert string to ASCII Value

Initial Tags
convert

Initial Language
PHP