Print array ...?

Hi guys i have a problem when i want to “print_r” my variable string that i’ve “explode”. the detail is below…

$var = “1,2,3,4,5”;
$sat = explode(‘,’,$var);

echo"<pre>“;
print_r($sat);
echo”</pre>";

i want to have result like this…

Array
(
[0] => Array
(
[new] => 1
)
[1] => Array
(
[new] => 2
)
[2] => Array
(
[new] => 3
)
[4] => Array
(
[new] => 4
)

)

but when i’m tried my script, it was not same like above. what is wrong with my script and what should i do guys. Please help me!

You will never get the expected result you want above as your array isn’t multidimensional, in order for you to achieve the above result you would need to construct the array with the “new” keys themselves.

$var  = '1,2,3,4,5';
$sat = explode(',', $var);

foreach ($sat as $k => $v) {
    $sat[$k] = array('new' => $v);
}

echo '<pre>';
print_r($sat);
echo '</pre>';