|
Posted by Rik on 10/17/06 00:40
..:[ ikciu ]:. wrote:
> Hmm NurAzije <nurazije@gmail.com> wrote:
>> Try this one, this will work :
>> ---------------------------------------------------
>> $test = explode('-','one-two-three-four-five');
>> $view = new Array();
>> foreach($test as $boo => $foo){
>> $view[$foo] = $foo; // typing error, do it like this
>> }
>>
>> print_r($view);
>
> still too much of lines ... try array_combine
Which Jan-Willem already said, and stated that it doesn't work on PHP < 5.
You seem to miss that the poster is trying to give a solution for PHP4.
About the question why the OP would want an array like this, it's beyond
me. I cannot see any advantage, but then again, I don't know what he's
trying to accomplish
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|