PHP MCQ Test: PHP MCQs - Practice Questions
1. How do you check if a string starts with a specific substring in PHP?
2. What is the purpose of the `while` loop in PHP?
3. How can you implement lazy loading in PHP?
4. What is the purpose of the `array` keyword in PHP?
5. What does the `static` keyword do in PHP?
6. What is the correct way to define a variable in PHP?
7. In PHP, what does the `use` keyword do in anonymous functions?
8. What is the purpose of the `array_push()` function in PHP?
9. What is the purpose of the `else` statement in PHP?
10. What is the purpose of the `__invoke()` magic method in PHP?
11. How do you connect to a MySQL database using PDO in PHP?
12. What is the purpose of the `__callStatic()` magic method in PHP?
13. What does PHP stand for?
14. How do you check if a variable is empty in PHP?
15. What is the purpose of the `array_map()` function in PHP?
16. What is the difference between `==` and `===` operators in PHP?
17. What is the purpose of the `array_diff()` function in PHP?
18. What is the use of the `filter_var()` function in PHP?
19. Which function is used to redirect the browser to another location in PHP?
20. What is the correct way to include a comment block in PHP?