How to create an empty array in PHP?

To create an empty array in PHP, you can use either of the following methods:

  1. Using the array() function: Declare an empty array using the array() function without any elements inside the parentheses. For example:
$emptyArray = array();
  1. Using the empty brackets notation: Declare an empty array using empty brackets. For example:
$emptyArray = [];

Both methods will create an empty array variable named $emptyArray that you can use to store elements later.