Welcome to your PHP Practice Test 4. This test can be taken unlimited times. Signed in users can have their scores saved to be viewed later. Questions will be randomly displaying each test. Good luck!

1. Which function is used to check if the variable is a number or not?
2. How do you destroy a cookie in PHP?
3. Parse error in PHP - unexpected T_variable at line X' mean?
4. What will be the result of the following expression?
1===1.0
5. Which of the following function is used to get the time a file was accessed?
6. Just like errors in PHP, you can also handle errors using try-catch blocks.
7. Which of the following is the correct syntax of foreach loop?
8. How do you concatenate two strings in PHP?
9. What is the output of the following code in PHP?

$pass = 0;
echo ('password' == $pass) ? 'true' : 'false';


 

10. What is the output of the following code in PHP?
<?php
$primes = array(1 => 'one', 2 => 'two', 3 => 'three', 5 => 'five', 7 => 'seven');
echo $primes[4]
?>
11. Which function is used to match alphabetic characters in PHP?
12. Which of the following character is used to access property on an object-by-object basis?
13. $GLOBALS is an associative array containing all the variables defined in the global scope.
14. What will be the output of the following code?

<?php
$A = new stdClass();
$A->member = "John";
$B = clone $A;
var_dump($A === $B);
?>
15. How many data types in PHP are classified as special types?
16. Which directive needs to be changed to increase the size of the files to be uploaded?
17. Which function is used to remove the HTML tags from the text?
18. What will be the output of the following code?

$x=-1;
if ($x)
echo "hi " ;
echo "how are u";
19. Which function is used to check if the variable is empty or not?
20. Which of the following function is used to read a complete file’s content into an array?


Last modified: January 3, 2020

Comments

Write a Reply or Comment

Your email address will not be published.