faqts : Computers : Programming : Languages : PHP : Function Libraries : Arrays

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 10 people (100%) answered Yes
Recently 9 of 9 people (100%) answered Yes

Entry

What is the most efficient way to combine & extract an array of about 20 separate digits (all 0-9) in a single mysql field (e.g. 1,2,1,0,5 as 12105)?

Jul 4th, 2001 08:57
Joachim Klinkhammer, Steve Dickson,


$arr1 = array(0, 1, 2, 3, 4, 5);

$a = implode("", $arr1);
$b = implode(",", $arr1);

$a is now '012345'
$b is now '0,1,2,3,4,5'

$arr2 = explode(",", $b);

$arr2 is now = $arr1