• What's the difference between include and require?

    If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

  • require_once(), require(), include().What is difference between them?

    require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.

  • Differences between GET and POST methods ?

    We can send 1024 bytes using GET method but POST method can transfer large amount of data and POST is the secure method than GET method .

  • What is the main difference between PHP 4 and PHP 5?

    PHP 5 presents many additional OOP (Object Oriented Programming) features.
  • What is the meaning of a final class and a final method?

    'final' is introduced in PHP5. Final class means that this class cannot be extended and a final method cannot be overrided.
  • What type of operation is needed when passing values through a form or a URL?

    If we would like to pass values througn a form or an URL then we need to encode and to decode them using htmlspecialchars() and urlencode().
  •  How can we access the data sent through the URL with the GET method?

    In order to access the data sent via the GET method, we you use $_GET array like this:www.url.com?var=value$variable = $_GET[“var”]; this will now contain ‘value’
  • Which function gives us the number of affected entries by a query?

    mysql_affected_rows() return the number of entries affected by an SQL query.
  • How can we access the data sent through the URL with the POST method?

    To access the data sent this way, you use the $_POST array. Imagine you have a form field called ‘var’ on the form, when the user clicks submit to the post form, you can then access the value like this:$_POST[“var”];
  • How can we check the value of a given variable is a number?

    It is possible to use the dedicated function, is_numeric() to check whether it is a number or not.
  • How can we check the value of a given variable is alphanumeric?

    It is possible to use the dedicated function, ctype_alnum to check whether it is an alphanumeric value or not.
  • How do I check if a given variable is empty?

    empty() function is used to check whether a variable has a value or not i.e. it is empty or not
  • What does the unlink() function mean?

    The unlink() function is dedicated for file system handling. It simply deletes the specified file.
  • What does the unset() function mean?

    The unset() function is dedicated for variable management. It will make a variable undefined.
  • Is it possible to remove the HTML tags from data?

    The strip_tags() function enables us to clean a string from the HTML tags.
  • What does accessing a class via :: (double colon) means?

    :: is used to access static methods that do not require object initialization.
  • What is the meaning of a Persistent Cookie?

    A persistent cookie is permanently stored in a cookie file on the browser’s computer. By default, cookies are temporary and are erased if we close the browser.
  • What does $GLOBALS mean?

    $GLOBALS is associative array including references to all variables which are currently defined in the global scope of the script.
  • What does $_SERVER mean?

    $_SERVER is an array including information created by the web server such as paths, headers, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here.
  • What does $_FILES mean?

    $_FILES is an associative array composed of items sent to the current script via the HTTP POST method.
  • What is the difference between the functions strstr() and stristr()?

    The string function strstr(string allString, string occ) returns part of allString from the first occurrence of occ to the end of allString. This function is case-sensitive. stristr() is identical to strstr() except that it is case insensitive.
    Source: http://career.guru99.com/top-100-php-interview-questions-answers/