1. Question:What is the functionality of the function strstr and stristr? 

    Answer
    strstr: It returns the remainder of a string beginning with the first occurrence of a predefined string.
    stristr: same as strstr except the search of for the pattern is case insensitive. 


    1. Report
  2. Question:How can we automatically escape incoming data? 

    Answer
    We have to enable the Magic quotes entry in the configuration file of PHP.

    1. Report
  3. Question:What is the difference between ereg_replace() and eregi_replace()?

     

    Answer
    ereg_replace(): it is used to find and replace a pattern with a replacement string.
    eregi_replace(): same as ereg_replace() except the search of for the pattern is case insensitive. 


    1. Report
  4. Question:What is property overloading?

     

    Answer
    Property overloading continues to protect properties by forcing access and manipulation through public methods, yet allowing the data to be accessed as if it were a public property.

    1. Report
  5. Question:What are the different functions in sorting an array?Discuss them?

     

    Answer
    sort(): sort array in ascending order. 
    rsort():sort array in descending order.
    asort() : Sort array  in ascending order with key/value.
    arsort(): reverse of assort.
    natsort (): sorting the in order we expect.
    natcasesort(): case insensitive natsort.
    ksort(): sorts an array by its keys.
    krsort(): reverse of ksort
    Usort(): sorting an array by using user defined comparison algorithm

    1. Report
  6. Question:Difference between get and post method?

     

    Answer
    GET Method: get method is used for submitting small amount of data. Data shows in the URL, so it is not secure.
    POST Method: post method is used for submitting small amount of data. Data does not show URL, so it is  secure.


    1. Report
  7. Question:What is super global variable? Write name of some superglobal variable?

     

    Answer
    The super global variables are predefined variable in PHP.  These are accessible from anywhere within a substantial amount of environment specified information. 
    Name of some super global variable:-
    $_GET[], $_POST[], $_REQUEST[], $_SERVER[], $_SESSION[], $GLOBAL[], $_COOKE[], $_FILES[] and $_ENV[].


    1. Report
  8. Question:What are constructor and destructor?

     

    Answer
    Constructor: It is automatic object creation process. It can call class methods and can accept paramiters.
    Destructor: It is automatic object destruction process. We can use destructors to modify the object destruction process.

    1. Report
  9. Question: What is the difference between print and printf?

     

    Answer
    The difference of print and printf are as the print statement is used output data passed to it, but the printf statement is used to output a blend of static text and dynamic information stored within one or several variable.

    1. Report
  10. Question:what is the difference between Exception::getMessage and Exception::getLine ? 

    Answer
    Exception::getMessage lets us getting the Exception message and Exception::getLine lets us getting the line in which the exception occurred.

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