Rated an average of 0 stars by 0 people

String to Ascii

Script Details:
Added on August 4, 2012 by YPY.
YPY accreditted the script to "Y.P.Y."

Description:
Convert strings to ASCII codes.

Tags: ascii, php, string

Code:

function String2ASCII($Str_Input)
{
    settype($Str_Input, 'string');
    $_Str_Output = NULL;

    for($i = 0; $i < strlen($Str_Input); $i ++)
    {
        $_Str_Output .= ('&#' . ord(substr($Str_Input, $i, $i + 1)) . ';');
    }

    return $_Str_Output;
}<?php
# Snippet from PHP Share: http://www.phpshare.org

?>

Review this PHP Script:

Rating:

Comments:


Login

User:
Pass:

Register

Not a member? Register today and receive the many free benefits of being a member!

Advertisements