Oh, yeah... my favorite:

explode()!

$var = '1,2,3,4,5,6,7,8,9,10';
$var_array = explode(',',$var);

/*
   will become:
   $var_array[0] = '1';
   $var_array[1] = '2';
   $var_array[2] = '3';
   $var_array[3] = '4';
   ... and so on
*/

as you notice the array starts from 0



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 11:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Parsing a string


I have a comma delimited string that I need to parse into an array.  Is
there a PHP function that will do that ?

Many thanks..........

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to