2010-04-05 124 views

回答

9
$array = explode($separator, $some_string); 
$array = array_combine($array, $array); 
2

你可以把它的像這樣的關聯數組:

$exploded = explode (.......); 
$exploded_associative = array(); 

foreach ($exploded as $part) 
if ($part) 
    $exploded_associative[$part] = $part; 

print_r($exploded_associative); // Will output "root" => "root" .... 

你到底需要什麼?

相關問題