Online Test for PHP
- PHP is an open source software
TrueFalse
- include_once is a ________.
FunctionStatementLanguage ConstructorAll of the above
- To create instance of class "new" keyword is not required.
TrueFalse
- Which is correct statement to terminate PHP statement?
Semicolon at the end of each statementThe closing tag of a block of PHP code automatically implies a semicolon;Colon at the end of each statementA & B
- How does the identity operator === compare two values?
It converts both to a common compatible data type and then compares the valuesIt returns True only if they are both of the same type and valueIt converts both values to strings and compares themIf the two values are strings, it performs a syntax comparison
- Find Error/Output in follwing code:
<?php
$strings = 'test test';
if (ctype_alpha($strings)) {
echo "The string consists of all letters.";
} else {
echo "The string does not consist of all letters.";
}
?>
The string does not consist of all letters.
The string consists of all letters.
Fatal Error
Syntax Error
- Find Error/Output in follwing code:
<?php
$val1 = 42;
if(is_numeric($val1)) {
echo "Integer";
} else {
echo "Not Integer";
}
$val2 = '42';
if(is_numeric($val2)) {
echo "Integer";
} else {
echo "Not Integer";
}
?>
Integer Integer
Integer Not Integer
Not Integer Integer
Not Integer Not Integer
- The variable name is case-sensitive in PHP.
TrueFalse
- In PHP, variable always start with _____?
%#&$
- list in PHP is ?
Language constructKeywordA & C BothNone of the above
Also Exercise
Post Your Question
Social Sharing
Search
Articles
Recently Added Jobs
Rajasthan High Court - Jodhpur Recruitment 2017 for Civil Judges
Last Date: 21 December, 2017
Last Date: 21 December, 2017
WBSEDCL Recruitment - 2017 for Office Executive
Last Date: 16 May, 2017
Last Date: 16 May, 2017
RECRUITMENT OF PROBATIONARY OFFICERS IN STATE BANK OF INDIA
Last Date: 06 March, 2017
Last Date: 06 March, 2017
UPSC Combined Medical Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015
UPSC Engineering Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015