Shaun wrote:
Hi,
I have am trying to create functions to convert strings to ascii and vice
versa:
http://www.php.net/ord
http://www.php.net/chr
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
or do something like:
function string_to_ascii( $str ) {
for( $i=0; $i < strlen( $str ); $i++ ) {
$ret = ord( substr( $str, $i ) );
$asc .= (string) ($ret < 10 ? '00' : ($ret < 100 ? '0' : '')) . $ret;
}
return $asc;
}
Mike wrote:
You should be able to do this quite well with the str_pad(
You should be able to do this quite well with the str_pad() function.
http://us3.php.net/manual/en/function.str-pad.php
-M
> -Original Message-
> From: Shaun [mailto:[EMAIL PROTECTED]
> Sent: Sunday, February 13, 2005 12:09 PM
> To: php-general@lists.php.net
> Subject: [PHP] Ensure a n
3 matches
Mail list logo