1. Question:What does PEAR stands for? 

    Answer
    PEAR means “PHP Extension and Application Repository”. it extends PHP and provides a higher level of programming for web developers.

    1. Report
  2. Question:What is the main difference between PHP 4 and PHP 5? 

    Answer
    PHP 5 presents many additional OOP (Object Oriented Programming) features.

    1. Report
  3. Question:Discuss five predefined subscript of $_FILES super global variable? 

    Answer

    a. $_FILES['file']['name']: The name of the file as uploaded from the client to the server. b. $_FILES['file']['type']: The MIME type of the uploaded file. Whether this variable is assigned depends on the browser capabilities. c. $_FILES['file']['size']: The byte size of the uploaded file. d. $_FILES['file']['tmp_name']: Once uploaded, the file will be assigned a temporary name before it is moved to its final location. e. $_FILES['file']['error']: An upload status code.

    1. Report
  4. 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
  5. Question:Why substr() is used?

     

    Answer
    The substr() function returns the part of a string located between a predefined starting offset and length positions.

    Its prototype : string substr(string str, int start [, int length])


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

     

    Answer
    ereg_replace(): ereg_replace() function is case sensitive.
    eregi_replace(): eregi_replace() function is not case sensitive. 

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

    Answer
    Ans: 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
  8. Question:Why explode() is used?

     

    Answer
    The explode() function splits a string into a series of substrings, with each string boundary determined by a specific separator.

    Its prototype: explode(string separator, string string [, int limit]).


    1. Report
  9. Question:What are passing arguments by reference and passing arguments by value?

     

    Answer
    Passing arguments by value: 
    Means any changes made to those values within the scope of the function are ignored outside of the function.
    Passing arguments by reference:
    Means any changes made to those values within the scope of the function are reflected outside of the function.

    1. Report
  10. Question:What does accessing a class via :: operator means? 

    Answer
    :: operator is used to access static methods that do not require object initialization.

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