In PHP, instructions are terminated with a _______.
-
;
-
#
-
!
-
%>
PHP instructions (statements) must be terminated with a semicolon (;), similar to many other programming languages like C, Java, and JavaScript. The semicolon tells the parser where the statement ends. This is required syntax in PHP - forgetting semicolons is a common syntax error.
To answer this question, you need to understand the syntax of PHP.
In PHP, instructions are terminated with a semicolon (;). This is known as the statement terminator. It is used to separate different statements or instructions in PHP code.
Let's go through each option to understand why it is correct or incorrect:
Option A) ; - This option is correct because in PHP, instructions are terminated with a semicolon (;). Option B) # - This option is incorrect. In PHP, the # symbol is used for single-line comments, not for terminating instructions. Option C) ! - This option is incorrect. In PHP, the exclamation mark (!) is used for logical negation, not for terminating instructions. Option D) %> - This option is incorrect. The %> symbol is used in PHP for closing a block of PHP code when using the alternative syntax, but it is not used to terminate instructions.
The correct answer is option A) ; because in PHP, instructions are terminated with a semicolon (;).