Let's say I have an array of key / value pairs in PHP:
array( 'foo' => 'bar', 'baz' => 'qux' );
What is the easiest way to convert this to an array that looks like this?
array( 'foo=bar', 'baz=qux' );
i.e.
array( 0 => 'foo=bar', 1 => 'baz=qux');
In perl, I would do something like
map { "$_=$hash{$_}" } keys %hash
Is there something similar in panoply array functions in PHP? Nothing I looked seemed like a convenient solution.
nohat source
share