LMSouq
php-dev Open

How to push both value and key into PHP array

GA
Gal
1 month ago
3 views
Problem Description
Take a look at this code: $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)

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base