How to add an array into an associative array in PHP? Subash Chandran 20th November 2021 Leave a Comment // for php 5.4+ $data += [$key => $value]; // for php 5.4- $data += array($key => $value); Curly hair, very fair, please share 🙂Click to share on Twitter (Opens in new window)Click to share on Facebook (Opens in new window)Click to share on Reddit (Opens in new window)Click to share on Telegram (Opens in new window)Click to share on WhatsApp (Opens in new window)Click to email a link to a friend (Opens in new window) Related See also Python code snippet - How to change entry in a row based on another columns entry ? Snippets How to add an array into an associative array in PHP? Change font size A Decrease font size. A Reset font size. A Increase font size.