You are here: Ensure a number is three digits long « PHP « IT news, forums, messages
Ensure a number is three digits long

Posted by Shaun on 02/13/05 19:09

Hi,

I have am trying to create functions to convert strings to ascii and vice
versa:

function string_to_ascii( $str ) {
for( $i=0; $i < strlen( $str ); $i++ ) {
$asc .= ord( substr( $str, $i ) );
}
return $asc;
}

This function works fine, however I need to ensure that the ASCII
convertions are three digits long so that I know where to split the ASCII
string when converting back to a normal string. i.e. 97 must be 097.

Thanks for any advice offered

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация