PHP WEB DEVELOPMENT INTERVIEW MCQ (MULTIPLE CHOICE QUESTIONS) PREPARED BY ME OF PITANGENT ANALYTICS AND TECHNOLOGY SOLUTIONS PVT. LTD FOR FRESHERS
PHP WEB DEVELOPMENT INTERVIEW MCQ (MULTIPLE CHOICE QUESTIONS) PREPARED BY ME OF PITANGENT ANALYTICS AND TECHNOLOGY SOLUTIONS PVT. LTD FOR FRESHERS
Q1. What will be the output of the following PHP code?
$x=5+"5";
echo $x;
a) 10 b) 55 c) Error d) NULL
Ans: a) 10 (Because 5+"5"=10 as "5" also denotes as 5 itself).
Q2. Which of the following is not a valid PHP function?
a) isset() b) unset() c) empty() d) clear()
Ans: d) clear().
Q3. What is the default scope of a vairable in PHP?
a) Public b) Private c) Global d) Local
Ans: d) Local.
Q4. What will count([1,2,3,4]) return?
a) 3 b) 4 c) 5 d) Error
Ans: b) 4 (As because in count() function there is 4 nos.).
Q5. What does explode(",","red,gree,blue") return?
a) String b) Array c) Object d) Boolean
Ans: b) Array (As because I know that explode() function is used to convert from string to array).
Q6. Which query returns the second highest salary from a employees table?
a) SELECT MAX(salary) FROM employees;
b) SELECT salary FROM employees ORDER BY salary DESC LIMIT 1,1;
c) SELECT TOP 2 salary FROM employees;
d) SELECT salary FROM employees WHERE ROWNUM=2;
Ans: b) SELECT salary FROM employees ORDER BY salary DESC LIMIT 1,1;
Q7. What does typeof null return in JavaScript?
a) null b) object c) undefined d) string
Ans: b) object.
Q8. Which jQuery code hides an element with id box?
a) $box.hide(); b) $("#box").hide(); c) box.hide(); d) $(hide).#box();
Ans: b) $( "#box").hide();
Q9. What will be the output of echo(int)((0.1+0.7)*10);?
a) 8 b) 7 c) 9 d) Error
Ans: a) 8 ( As because 0.1+0.7=0.8 and 0.8*10=8).
Q10. Which of the following is a valid PHP variable name?
a) 1var b) $_var c) -var d) @var
Ans: b) $_var.
Q11. What does isset($x) return if $x=null;?
a) true b) false c) null d) error
Ans: b) false.
Q12. Which of the following is used to terminate script execution in PHP?
a) exit() b) stop() c) halt() d) break()
Ans: a) exit().
Q13. What does explode("-","PHP-MySQL-Java") return?
a) String b) Object c) Array d) Null
Ans: c) Array (As because I know that explode() function is used to convert from string to array).
Q14. Which function finds the position of a string inside another string?
a) strpos() b) strfind() c) strsearch() d) strposof()
Ans: a) strpos().
Q15. Which keyword is used for inheritance in PHP?
a) inherit b) extends c) inherits d) base
Ans: b) extends.
Q16. Which magic method is called when an object is created?
a) __init__() b) __build() c) __construct() d) __start()
Ans: c) __construct() (As because I know that __construct() function is the magic keyword which is denoted by double underscore(__)).
Q17. What is the visibility of a property accessed only from its own class?
a) public b) protected c) private d) static
Ans: c) private.
Q18. What is the default port of MySQL?
a) 3306 b) 8080 c) 1433 d) 1521
Ans: a) 3306.
Q19. Which keyword is used to remove duplicate rows in SQL?
a) UNIQUE b) DISTINCT c) ONLY d) FILTER
Ans: b) DISTINCT.
Q20. What is the command to show all databases in MYSQL?
a) SHOW DATABASES; b) DISPLAY DB;
c) LIST DATABASES; d) VIEW ALL;
Ans: a) SHOW DATABASES;
Q21. How do you write a jQuery selector for an element with class btn?
a) $(".btn") b) $("#btn") c) $("btn") d) $(.btn)
Ans: a) $(".btn").
Q22. Which tag is used to create a table row in HTML?
a) <td> b) <th> c) <tr> d) <row>
Ans: c) <tr>.
Q23. What is the correct Bootstrap class for a green button?
a) btn-green b) btn-success c) btn-primary d) btn-default
Ans: b) btn-success.
Comments
Post a Comment