To create an empty array in PHP, you can use the array() function with no arguments. Here's an example:
main.php20 chars2 lines
You can also use the shorthand syntax:
main.php15 chars2 lines
Either way, $myArray
will be an empty array that you can add elements to using the []
syntax or the array_push()
function.
gistlibby LogSnag