Re: int to array

From: Date: Fri, 15 Dec 2000 18:16:09 +0000
Subject: Re: int to array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30554@lists.php.net to get a copy of this message
what about something like this (off the top of my head and untested): function nr2arr( &$nr ) { $x = array() ; if( settype( $nr , 'string' ) ) { for( $i = 0 ; $i < strlen( $nr ) ; $i++ ) { $x[] = $nr[ $i ] ; } $nr = $x ; return true ; } return false ; } At 01:08 15.12. 2000, Jerry Lake wrote the following: -------------------------------------------------------------- >how do I turn a number in to an array >i.e. $test=123456789; >$test = array($test); >echo $test[0]$test[2]$test[5]; > >Jerry Lake > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. cynic@mail.cz ICQ: 2808 2505

« previous php.general (#30554) next »