Convert string to ASCII Value


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. function string_to_ascii($string)
  2. {
  3. $ascii = NULL;
  4.  
  5. for ($i = 0; $i < strlen($string); $i++)
  6. {
  7. $ascii += ord($string[$i]);
  8. }
  9.  
  10. return($ascii);
  11. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.