I'm fairly new to PHP and I was wondering about the proper way to declare variables in this language. I've seen different people using different methods, so I thought it would be a good idea to seek some clarification here.
From what I've gathered, there are a few ways to declare variables in PHP. One common method I've seen is using the dollar sign ($) followed by the variable name. For example:
$myVariable = "Hello World";
Another way I've come across is using the `var` keyword before the variable name, like this:
var $myVariable = "Hello World";
I'm a bit confused about the difference between these two approaches and which one is considered the standard or best practice. It would be great if someone could shed some light on this topic.
Additionally, if there are any other recommended ways to declare variables in PHP, I'd love to hear about them too.
Thanks in advance for your help!