1. Question:What is the use of isset() in PHP? 

    Answer
    This function is used to determine if a variable is set and is not NULL

    1. Report
  2. Question:What is the static variable in function useful for? 

    Answer
    A static variable is defined within a function only the first time and its value can be modified during function calls as follows:
    <?php 
    function testFunction() { 
     static $testVariable = 1;
     echo $testVariable; 
     $testVariable++; 
    } 
    testFunction();        //1 
    testFunction();        //2 
    testFunction();        //3 
    ?>

    1. Report
  3. Question:How is it possible to cast types in PHP? 

    Answer
    The name of the output type have to be specified in parentheses before the variable which is to be cast as follows:
    
    * (int), (integer) – cast to integer
    
    * (bool), (boolean) – cast to boolean
    
    * (float), (double), (real) – cast to float
    
    * (string) – cast to string
    
    * (array) – cast to array
    
    * (object) – cast to object

    1. Report
  4. Question:What are the PHP’s authentication variables? 

    Answer
    PHP uses two predefined variables to authenticate a user and those are $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']. These variables store the username and password values, respectively.

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