Question 1. Which Will Print Out The Php Call Stack?
Answer :
var_dump($e->getTraceAsString());
Question 2. What Enctype Is Required For File Uploads To Work?
Answer :
multipart/form-data
Question 3. Which Is Not A File-related Function In Php?
Answer :
fappend
Question 4. What Would Occur If A Fatal Error Was Thrown In Your Php Program?
Answer :
The PHP program will stop executing at the point where the error occurred.
Question 5. What Is The String Concatenation Operator In Php?
Answer :
( . )
Question 6. Which Function Can Be Used To Delete A File?
Answer :
unlink
Question 7. What Function Should You Use To Join Array Elements With A Glue String?
Answer :
implode
Question 8. Which Is Useful For Method Overloading?
Answer :
__call,__get,__set
Question 9. Which Is True About The Singleton Design Pattern?
Answer :
A singleton pattern means that a class can have only one instance object.
Question 10. Which Is Incorrect With Respect To Separating Php Code And Html?
Answer :
As PHP is a scripting language, HTML and PHP cannot be separated.
Question 11. Which Is The Correct Way To Check If A Session Has Already Been Started ?
Answer :
if (session_id()) echo ‘session started’;
Question 12. Which Cryptographic Functions In Php Returns The Longest Hash Value?
Answer :
sha1()
Question 13. Which Will Start A Session?
Answer :
session_start();
Question 14. Which Variable Declarations Within A Class Is Invalid In Php?
Answer :
internal $term = 3;
Question 15. Does Php 5 Support Exceptions?
Answer :
Yes,PHP 5 supports Exceptions.
Question 16. What Is The Best Practice For Running Mysql Queries In Php? Consider The Risk Of Sql Injection.
Answer :
Use PDO prepared statements and parameterized queries: for example: $input= $_POST[“user-input”] $stmt = $pdo->prepare(‘INSERT INTO table (column) VALUES (“:input”); $stmt->execute(array(‘:input’ => $input));
Question 17. What Is The Correct Line To Use Within The Php.ini File, To Specify That 128mb Would Be The Maximum Amount Of Memory That A Script May Use?
Answer :
memory_limit = 128M
Question 18. Which Function Will Suitably Replace ‘x’ If The Size Of A File Needs To Be Checked? $size=x(filename);
Answer :
filesize
Question 19. Which Methods Should Be Used For Sending An Email Using The Variables $to, $subject, And $body?
Answer :
mail($to,$subject,$body)
Question 20. Which Is Not A Php Magic Constant?
Answer :
Time
Question 21. Which Is Used To Maintain The Value Of A Variable Over Different Pages?
Answer :
session_register() is used to maintain the value of a variable over different pages.
Question 22. What Is The Best Way To Change The Key Without Changing The Value Of A Php Array Element?
Answer :
$arr[$newkey] = $arr[$oldkey]; unset($arr[$oldkey]);
Question 23. Which Will Check If A Function Exists?
Answer :
function_exists()
Question 24. What Is The Correct Syntax Of Mail() Function In Php?
Answer :
mail ($to, $subject, $message,$headers)
Question 25. Can Php Use Gettext?
Answer :
Yes. We can use gettext in PHP.
Question 26. What Is The Correct Php Command To Use To Catch Any Error Messages Within The Code?
Answer :
set_error_handler(‘error_handler’);
Question 27. Which Is Correct About Mysqli And Pdo?
Answer :
Mysqli can only be used to access MySQL database while PDO can be used to access any DBMS.
PHP Interview Questions
PHP Tutorial
MySQL Interview Questions
MySQL Tutorial
PHP+MySQL Interview Questions
Drupal Interview Questions
Drupal Tutorial
MYSQL DBA Interview Questions
PHP Interview Questions
WordPress Tutorial
WordPress Interview Questions
Joomla Tutorial
Joomla Interview Questions
MySQL Interview Questions
CakePHP Tutorial
CakePHP Interview Questions
CodeIgniter Tutorial
CodeIgniter Interview Questions
PHP+MySQL Interview Questions
PHP7 Tutorial
PHP7 Interview Questions
Drupal Interview Questions