How to push both value and key into array with php
Posted
by sombe
on Stack Overflow
See other posts from Stack Overflow
or by sombe
Published on 2010-01-23T00:44:22Z
Indexed on
2010/05/28
3:41 UTC
Read the original article
Hit count: 236
$GET = array();
$key = 'one=1';
$rule = explode('=',$key);
/* array_push($GET,$rule[0]=>$rule[1]); */
I'm looking for something like this so that:
print_r($GET);
/*output:*/ $GET[one=>1,two=>2,...]
is there a function to do this (because array_push won't work this way).
thanks!
© Stack Overflow or respective owner