Posted By

AzizLight on 11/26/09


Tagged

php ascii


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

MMDeveloper


Convert string to ASCII


 / Published in: PHP
 

  1. function to_ascii($string)
  2. {
  3. $ascii_string = '';
  4. foreach (str_split($string) as $char)
  5. {
  6. $ascii_string .= '&#' . ord($char) . ';';
  7. }
  8. return $ascii_string;
  9. }

Report this snippet  

You need to login to post a comment.