PHP Quiz

1. Which PHP function is used to check if a variable is an array?

2. What is the purpose of the abstract keyword in PHP?

3. Which PHP function is used to sort an array in ascending order by value, maintaining index association?

4. What does the final keyword in PHP prevent?

5. Which PHP function is used to calculate the length of a string?

6. What is the purpose of the trait keyword in PHP?

7. Which PHP function is used to replace all occurrences of a search string with a replacement string?

8. What does the static keyword in PHP indicate?

9. Which PHP function is used to retrieve the value of an environment variable?

10. What is the purpose of the try...catch block in PHP?

11. Which PHP function is used to encode a URL?

12. What does the protected access modifier in PHP indicate?

13. Which PHP function is used to format a date and time?

14. What is the purpose of the __construct() method in a PHP class?

15. Which PHP function is used to retrieve the keys of an array?

16. What is the purpose of the __destruct() method in a PHP class?

17. Which PHP function is used to filter elements of an array using a callback function?

18. What does the clone keyword in PHP do?

19. Which PHP function is used to get the current working directory?

20. What is the purpose of the declare(strict_types=1); directive in PHP?