How can one efficiently store multiple values in an array in PHP without overwriting the previous values?

When storing multiple values in an array in PHP, you can use the array_push() function to add new values to the end of the array without overwriting the previous values. This function appends one or more elements to the end of an array. By using array_push(), you can efficiently store multiple values in an array while preserving the existing values.

// Initialize an empty array
$values = [];

// Add new values to the array without overwriting the previous values
array_push($values, "value1", "value2", "value3");

// The array now contains "value1", "value2", "value3"