Php5 Interview Questions with Answers
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-facts
PHP Interview Questions
Question: 3. Which Is Not A File-associated Function In Php?
Answer:
fappend
Question: four. What Would Occur If A Fatal Error Was Thrown In Your Php Program?
Answer:
The PHP program will prevent executing at the point in which the mistake passed off.
PHP Tutorial
Question: 5. What Is The String Concatenation Operator In Php?
Answer:
( . )
MySQL Interview Questions
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
MySQL Tutorial PHP+MySQL Interview Questions
Question: 8. Which Is Useful For Method Overloading?
Answer:
__call,__get,__set
Question: nine. Which Is True About The Singleton Design Pattern?
Answer:
A singleton sample approach that a class could have simplest one instance item.
Drupal Interview Questions
Question: 10. Which Is Incorrect With Respect To Separating Php Code And Html?
Answer:
As PHP is a scripting language, HTML and PHP can’t be separated.
Drupal Tutorial
Question: 11. Which Is The Correct Way To Check If A Session Has Already Been Started ?
Answer:
if (session_id()) echo ‘consultation began’;
MYSQL DBA Interview Questions
Question: 12. Which Cryptographic Functions In Php Returns The Longest Hash Value?
Answer:
sha1()
PHP Interview Questions
Question: thirteen. Which Will Start A Session?
Answer:
session_start();
WordPress Tutorial
Question: 14. Which Variable Declarations Within A Class Is Invalid In Php?
Answer:
inner $term = three;
Question: 15. Does Php five Support Exceptions?
Answer:
Yes,PHP five helps Exceptions.
WordPress Interview Questions
Question: 16. What Is The Best Practice For Running Mysql Queries In Php? Consider The Risk Of Sql Injection.
Answer:
Use PDO organized statements and parameterized queries: as an example: $enter= $_POST[“user-input”] $stmt = $pdo->prepare(‘INSERT INTO table (column) VALUES (“:enter”); $stmt->execute(array(‘:enter’ => $enter));
Joomla Tutorial
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
Joomla Interview Questions
Question: 18. Which Function Will Suitably Replace ‘x’ If The Size Of A File Needs To Be Checked? $length=x(filename);
Answer:
filesize
MySQL Interview Questions
Question: 19. Which Methods Should Be Used For Sending An Email Using The Variables $to, $concern, And $frame?
Answer:
mail($to,$challenge,$frame)
CakePHP Tutorial
Question: 20. Which Is Not A Php Magic Constant?
Answer:
Time
CakePHP Interview Questions
Question: 21. Which Is Used To Maintain The Value Of A Variable Over Different Pages?
Answer:
session_register() is used to maintain the price 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]);
CodeIgniter Tutorial
Question: 23. Which Will Check If A Function Exists?
Answer:
function_exists()
CodeIgniter Interview Questions
Question: 24. What Is The Correct Syntax Of Mail() Function In Php?
Answer:
mail ($to, $issue, $message,$headers)
PHP+MySQL Interview Questions
Question: 25. Can Php Use Gettext?
Answer:
Yes. We can use gettext in PHP.
PHP7 Tutorial
Question: 26. What Is The Correct Php Command To Use To Catch Any Error Messages Within The Code?
Answer:
set_error_handler(‘error_handler’);
PHP7 Interview Questions
Question: 27. Which Is Correct About Mysqli And Pdo?
Answer:
Mysqli can simplest be used to get right of entry to MySQL database while PDO can be used to get admission to any DBMS.
Drupal Interview Questions
