Ordered array to associative array, odd values as keys
问题 Pretty straightforward: // turn array('foo', 'bar', 'hello', 'world'); // into array('foo' => 'bar', 'hello' => 'world'); Right now I'm using: do{ $arrayOut[current($arrayIn)] = next($arrayIn); }while(next($arrayIn)); I'm wondering if there's a way to do it without the intermediary variable, $arrayOut . I could write a function, however this is a single use case, and I'm trying to keep my script uncluttered. I'm just wondering if there's something I missed in the docs that would serve this