+1 vote
in PHP by
Which of the following is the correct way of defining a variable in PHP?

a) $variable name = value;

b) $variable_name = value;

c) $variable_name = value

d) $variable name as value;

1 Answer

0 votes
by
b) $variable_name = value;

Description:

In PHP, a variable is declared using a $ sign followed by the variable name. A PHP variable name cannot contain spaces.

Syntax of declaring a variable in PHP is given below:

$variable_name=value;

Related questions

0 votes
asked Jun 22, 2019 in PHP by SakshiSharma
+1 vote
asked May 11, 2022 in PHP by sharadyadav1986
...