I have this:
$strVar = \"key value\";
And I want to get it in this:
array(\'key\'=>\'value\')
I tried
$strVar = "key value"; list($key, $val) = explode(' ', $strVar); $arr= array($key => $val);
Edit: My mistake, used split instead of explode but:
split() function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged