How to push both value and key into PHP array

Nope, there is no array_push() equivalent for associative arrays because there is no way determine the next key.

You’ll have to use

$arrayname[indexname] = $value;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)