Hey everyone,
I've been working on a project in PHP and I'm currently facing an issue. I want to add a PHP variable to an array, but I'm not quite sure how to go about it. I have a variable called `$myVariable` which holds a certain value, let's say "Hello". Now, I want to add this variable to an existing array called `$myArray`.
Here's what my array looks like:
```php
$myArray = array(
"apple",
"banana",
"orange"
);
```
I want to add `$myVariable` to this array. So, after the operation, my updated array should look like this:
```php
$myArray = array(
"apple",
"banana",
"orange",
"Hello"
);
```
Can someone please guide me on how I can achieve this? Any help would be greatly appreciated.
Thanks!

Hey everyone,
I noticed this question and thought I'd share an alternative approach based on my personal experience. In addition to using `array_push()`, you can directly assign the variable as a new element in the array using square bracket notation.
Here's how you can do it:
By using the empty square brackets `[]`, PHP will automatically assign the value of `$myVariable` as the next element in the array. This eliminates the need for the `array_push()` function.
Personally, I find this method a bit more straightforward when adding individual elements to an array.
Feel free to give it a try and let me know if you have any questions or concerns!
Best regards,
User 2