FUNDAMENTALS OF COMPUTER

TELECOMMUNICATIONS SYSTEMS

NETWORK ARCHITECTURE

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In PHP assigning value to a variable may look like this:
A
$ ____ myname = “Vanness”
B
myname = “Vanness”
C
$myname = “Vanness”
D
var myname = “Vanness”
Explanation: 

Detailed explanation-1: -Rules for PHP variables: A variable starts with the $ sign, followed by the name of the variable. A variable name must start with a letter or the underscore character. A variable name cannot start with a number.

Detailed explanation-2: -The $var (single dollar) is a normal variable with the name var that stores any value like string, integer, float, etc.

Detailed explanation-3: -Definition and Usage The var keyword creates a property in a class. Since PHP 5, it is equivalent to the public keyword. Note: The var keyword is only used for compatibility reasons. Since PHP 5, the keywords private, protected and public should be used instead.

Detailed explanation-4: -It means pass the variable by reference, rather than passing the value of the variable.

There is 1 question to complete.