1. Question:Write the name of 9 Superglobal Variables______. 

    Answer
    "$_GET[ ], $_POST[ ], $_REQUEST[ ], $_SERVER[ ], $_SESSION[ ], $GLOBAL[ ], $_COOKE[ ], $_FILES[ ], $_ENV[ ], "

    1. Report
  2. Question:Write some of PHP benefits compare to other language? 

    Answer
    - PHP runs on different platforms (Windows, Linux, Unix, etc.)
    - PHP is compatible with almost all servers used today (Apache, IIS, etc.)
    - PHP is FREE to download from the official PHP resource: www.php.net
    - PHP is easy to learn and runs efficiently on the server side

    1. Report
  3. Question:What is a PHP File? 

    Answer
    - PHP files may contain text, HTML tags and scripts
    - PHP files are returned to the browser as plain HTML
    - PHP files have a file extension of ".php", ".php3", or ".phtml"

    1. Report
  4. Question:Between echo () and print () functions which one is the faster and why? 

    Answer
    The echo () function is a tad faster than print() function, because it returns nothing, whereas print() function returns 1 if the statement is successfully output.

    1. Report
  5. Question:What is PHP? 

    Answer
    - PHP stands for PHP: Hypertext Preprocessor
    - PHP is a server-side scripting language, like ASP
    - PHP scripts are executed on the server
    - PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL,
    Generic ODBC, etc.)
    - PHP is an open source software (OSS)
    - PHP is free to download and use

    1. Report
  6. Question: What are type casting and juggling? 

    Answer
    Ans:  Type casting:  converting values from one data type to another is known as type casting.
             Juggling: Automatic conversion is known as type juggling.


    1. Report
  7. Question:What are the different types of errors in PHP? 

    Answer
    1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example,
    accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all
    - although you can change this default behavior.2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist.
    By default, these errors are displayed to the user, but they do not result in script termination.3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling
    a non-existent function. These errors cause the immediate termination of the script, and PHP’s default
    behavior is to display them to the user when they take place.

    1. Report
  8. Question:Between echo () and print () functions which one is the faster and why?

     

    Answer

    The echo () function is a tad faster because it returns nothing, whereas print() will return 1 if the statement is successfully output.

    1. Report
  9. Question:What are type casting and juggling? 

    Answer
    Casting: Converting values from one data type to another is known as type casting. This is accomplished by placing the intended type in front of the variable to be cast.example:
    $x=34.54;
    $y=(int)$x;
    echo $y; // returns 34Juggling: Variables are sometimes automatically cast to best fit the circumstances in which they are referenced. This is known as Type Juggling.example:
    $a="34 items"
    $total=5;
    $total+=$a;
    echo $total;// returns 39

    1. Report
  10. Question:What is constant? How can you declare a constant? 

    Answer
    A constant is a value that cannot be modified throughout the execution of a program. Constants are particularly useful when working with values that definitely will not require modification, such as Pi (3.141592). Once a constant has been defined, it cannot be changed (or redefined) at any other point of the program. Constants are defined using the define() function in php.

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd