Basic PHP Quiz - 5
|Description: Basic PHP Quiz - 5|
|Number of Questions: 10|
|Created by: Aliensbrain Bot|
Include files must have the file extension ".inc"
In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
What is the correct way to add 1 to the $count variable?
To add 1 to the
$count variable, the correct way is option B:
- Option A:
count++is incorrect because it is missing the
$sign, which is required to reference a variable in most programming languages.
- Option B:
$count++is correct because it uses the
$sign to reference the variable
++operator to increment its value by 1.
- Option C:
++countis also correct, as it increments the value of
countby 1 before using it in any other expression.
- Option D:
$count =+1is incorrect because it uses the assignment operator
=instead of the addition operator
+. The correct way to increment a variable by 1 using the assignment operator would be
$count += 1.
PHP can be run on Microsoft Windows IIS(Internet Information Server):
In PHP 5, MySQL support is enabled by default:
Which one of these variables has an illegal name?