Cracking PHP Interviews : 50 Questions and Answers


Free $19.99 Coupon

Cracking PHP Interviews : 50 Questions and Answers, Get Ready for your PHP Interview with 50 PHP Interview Questions.

How about Quickly Revising all the Important PHP Concepts in less than 2 Hours before an interview?

Preparing for PHP Interview is tricky. You would need to get a good understanding of new features and revise concepts you used in your preparation. This course helps you Prepare for PHP Interview with hands-on code examples covering 50 PHP Interview Questions and Answers on varied range of topics listed below.

What You Can Expect from this Course

✔ Real Interview Questions with detailed answers

✔ Friendly Support in the Q&A section

✔ Free Udemy Certificate of Completion on Completion of Course

✔ 30 Day “No Questions Asked” Money Back Guarantee!

Zero risk. 30 day money-back guarantee with every purchase of the course. You have nothing to lose!

Start Learning Now. Hit the Enroll Button!

Questions Discussed in this Interview Course

PHP Platform

  • What is PHP?
  • Is PHP case sensitive?
  • Is PHP weakly typed language?
  • How do we install PHP?
  • What is Composer?
  • What is Packagist?
  • How do we execute a PHP script from the command line?
  • What is virtual host?
  • What are XAMPP & WAMP?
  • What is Apache server?
  • How to check current PHP version and other information about our system?
  • What is interpreter?
  • Is PHP compiled or interpreted?
  • What do we mean by a Framework?
  • What is MVC?

Datatypes and variables

  • What is a datatype?
  • How many datatypes are there?
  • What are rules for naming a variable?
  • How will you define a constant?
  • What is the purpose of constant() function?
  • What are the differences between constants and variables?
  • What are the different scopes of variables?
  • What is string?
  • What is the difference between single quoted string and double quoted string?
  • How can you convert string into array elements?
  • How can you convert array into strings?
  • How can you concatenate two or more strings?
  • Differentiate between echo and print().
  • Explain static variables.
  • What are PHP magic constants?
  • Why do we need trim() function?
  • Can you count the number of words in a string?
  • How to reverse a string?
  • How can you change cases in a string?
  • Can you replace a substring?
  • Differentiate between str_replace() and str_ireplace().
  • Differentiate between printf() and print().
  • Differentiate between strstr() & strchr() functions.
  • Differentiate between strstr() and stristr().
  • Can you encode a string in PHP?
  • Differentiate between strcmp() and strncmp().
  • Is it possible to remove the HTML tags from data?
  • What is the use of gettype() in PHP?
  • What is heredoc and nowdoc?

Flow control and Iterations

  • Explain if-else statement.
  • Explain switch statement with example.
  • Differentiate between switch and if-else statement.
  • What are the different types of operators?
  • Explain arithmetic operators.
  • Explain the assignment operators.
  • Explain the logical operators.
  • Explain the unary operators.
  • Explain the comparison operators.
  • Differentiate between === and == operators in PHP.
  • Explain pre and post increment with example.
  • What do you mean by operator overloading?
  • How many loops are available in PHP?
  • Explain while loop with example.
  • Explain do-while loop with example.
  • Explain for loop with example.
  • Explain foreach loop with example.
  • How can you implement an infinite loop in PHP?
  • How can you implement recursion in PHP?
  • Differentiate between iteration and recursion.
  • Explain break statement with example.
  • Explain continue statement with example.
  • Give example of declaration in php?
  • What is require in PHP?

Following questions are available with the Q&A PDF provided in the course (videos on following questions are coming soon)


  • What is an array?
  • How can you print an array in PHP?
  • What do we mean by the base address of an array?
  • What do we mean by keys and values?
  • What are the keys & values in an indexed array?
  • How can we convert array into string?
  • How can we convert a string into an array elements?
  • How can we concatenate arrays in PHP?
  • Which function counts all the values of an array?
  • How can we check if an element exists in an array?
  • Which function inserts an element to the end of an array?
  • What is the use of array_chunk() function?
  • Why do we use extract()?


  • What is a function?
  • What are the different types of functions?
  • Classify function on basis of parameters.
  • Differentiate between parameterized and non parameterized functions.
  • Does PHP support both call by cvalue and call by reference?
  • Explain call by value.
  • Explain call by reference.
  • What are the function declaration rules?
  • How can we declare user defined functions?
  • What do we mean by actual and formal parameters?
  • Maximum how many arguments are allowed in a function in PHP?
  • Explain header().
  • What do we mean by return type of a function?
  • What is the return type of a function that doesn’t return anything?
  • Do we need to mention the return type of a function explicitly in PHP?
  • What is function that can be used to build a function that accepts any number of arguments?
  • Explain the return statement.
  • Can we use multiple return statements in a function?
  • What is the use of ini_set()?
  • What is the difference between unlink and unset functions?
  • How ereg() function works?
  • How eregi() function works?
  • What is the purpose of getdate() function?
  • What is the purpose of date() function?
  • How will you call member functions of a class?

Requests and responses

  • How can we display the correct URL of the current webpage?
  • How to get the information about the uploaded file in the receiving script?
  • What do we mean by server?
  • What is a client?
  • What do you mean by a response?
  • What is HTTP?
  • What are PHP superglobals?
  • How will we get information sent via GET method?
  • How will you get information sent via POST method?
  • What is the purpse $_REQUEST variable?
  • What is the purpose of $_FILES variable?
  • What is the purpose of $GLOBALS variable in PHP?
  • What is the purpose of $_SERVER variable in PHP?
  • What is the purpose of $_COOKIE variable in PHP?
  • What do you mean by environment variable in PHP?
  • What is the purpose of $_ENV variable in PHP?
  • What is the purpose of $_SESSION variable in PHP?
  • How will you redirect a page?
  • What is the purpose $_PHP_SELF variable?
  • How will you get the browser’s details using PHP?
  • What do you mean by HTTP status codes?
  • What are the HTTP client error codes?
  • What are the informational status codes?
  • What are the HTTP success codes?
  • How do you get the redirection related information?
  • What are the HTTP client error codes?
  • What are the HTTP server error codes?
  • What is API?
  • What is the use of an API?
  • What are types of API?
  • What is REST API?
  • Why do we need REST API?
  • Where REST API is used?
  • What is JSON?
  • Why do we need JSON?
  • How can you exchange data using JSON?
  • Differentiate between JSON & XML.
  • What are the advantages of JSON?

Sessions and Cookies

  • What is Session?
  • What is Cookie?
  • Differentiate between Session & Cookie.
  • How do we start a session?
  • How can we set session variable?
  • How to destroy a session?
  • How to remove value from session variable?
  • When do we need to set session variables?
  • When do we need a session and not a cookie?
  • When do we need a cookie and not a session?
  • How can we set a cookie?
  • How to modify a cookie value?
  • How will we make a check that a cookie is set or not?
  • How to retrieve all cookie values?
  • How to delete a cookie?
  • How can we implement ‘remember me’ using PHP?
  • Classify cookies.
  • How will you delete a cookie?
  • How to track login and logout using PHP?

Filesystem management

  • How to create a file?
  • What are the other way to write in a file?
  • How will you check if a file exists or not using php?
  • How to delete a file?
  • How to copy a file?
  • How to rename file?
  • How to check whether a file or directory exists?
  • How to check path of the file in PHP?
  • How to check size of the file in PHP?
  • How to write the contents inside file?
  • Explain file() method.
  • How To change the file permissions?
  • What are different ways to get the extension of a file?
  • How to create a directory using PHP?
  • How to get files(contents) from directory?
  • How to open a directory?
  • What is include in php?
  • What is require_once in php?
  • What is include_once in php?
  • What is require() in PHP?
  • What is difference between require and include?

Regular Expressions

  • What is RegEx?
  • Why do we need RegEx?
  • How preg_match() function works?
  • Regualar Expression Notations.
  • Regualar Expression Examples.

OOPs Concepts

  • What is OOPs?
  • What is an object?
  • How can we create object of a class?
  • What is a class?
  • What are the basic features of OOPs?
  • Is PHP purely an object oriented language?
  • Differentiate between OOPs & POPs.
  • What is generalization?
  • What is specialization?
  • What is aggregation?
  • What is composition?
  • What is association?
  • What is abstraction?
  • What is encapsulation?
  • What is inheritance?
  • What is super class?
  • What is a sub class?
  • How can you inherit a class in PHP?
  • What is a constructor?
  • Explain __construct().
  • Classify constructor.
  • What is a destructor?
  • Explain $this.
  • Explain multiple inheritance.
  • Does PHP support multiple inheritance?
  • Explain multi-level inheritance.
  • What is polymorphism?
  • What is method overloading?
  • Does PHP support method overloading?
  • What is method overriding?
  • What are interfaces in PHP?
  • What does the presence of operator ‘::’ represent?
  • How to define a class in PHP?
  • How will you add a constructor function to a PHP class?
  • How will you add a destructor function to a PHP class?
  • How will you access the reference to same object within the object in PHP?
  • What do you mean by access modifier?
  • Explain access modifiers in PHP.
  • Explain final class in PHP.
  • Explain abstract class.
  • What is interface?

Exception Handling

  • What do you mean by an exception?
  • Define Exception class Hierarchy.
  • How do we handle exceptions?
  • Differentiate between exception and error.
  • What do we mean by error log?
  • How do we see PHP errors?
  • What are the exception class functions?
  • What does the expression Exception::__toString means?

Security and Cryptography

  • Why do we need cryptography?
  • What do we mean by hash functions?
  • Whart is hash function in PHP?
  • Example using hash().
  • What is encoding and decoding?
  • What is SHA1?
  • Can sha1 be decrypted?
  • What is sha1_file()?
  • What are the disadvantages of sha1()?
  • What MD5 means?
  • Why can not a MD5 hash be decrypted?
  • Is md5 reversible?
  • Compare sha1() and md5().
  • What is enctype?
  • Explain each Mcrypt function supported in PHP.
  • What is cryptography authentication?


  • What is HTML?
  • Differentiate between PHP and HTML.
  • What are the different methods or HTTP verbs of sending data to the server?
  • What’s the difference between GET and POST methods.
  • How can we send email?
  • How file upload works?


  • What is SQL?
  • Why do we need SQL with PHP?
  • How many types of database connections possible in PHP.
  • Adavantages of PDO over MySQLi approach.
  • How connect to the database using PDO?
  • What is SQL injection?


  • How can we get the browser’s details using PHP
  • What is the use of Xdebug extension?
  • What is the purpose of php.ini file?
  • What is curl?
  • What is PDO in PHP?
  • What is autoloading classes in PHP?
  • Discuss die().
  • What are variable variable?

New features in PHP 7

  • What are return type declarations?
  • Explain the Exception Hierarchy introduced in PHP 7?
  • What is use of Spaceship Operator?
  • What is use of Null Coalesce Operator?

We will be happy to hear your thoughts

      Leave a reply

      Courses Will Be Sent To Your Inbox
      Join 13,000+ Subscribers

      Subscribe to our mailing list and get paid courses for free direct to your email inbox.

      Register New Account
      Reset Password