Home / PHP Tips Generated By ChatGPT / Appending to an Array in PHP Directly append an item to an array without specifying a key. Source Code $array = ["apple", "banana"]; $array[] = "cherry"; print_r($array); // Adds "cherry" to the array