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:What are the types of key of array?

     

    Answer
    Each array consists of two components. Key and value. Keys can be numerical or associative. Numerical key can be use numeric value and associative key use string value.







    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:Define exceptions? 

    Answer
    Ans: An exception is an abnormal condition that arises in a code sequence at run time. Basically there are four important keywords which form the main pillars of exception handling: try, catch, throw and finally.







    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.

    ksort(): sorts an array by its keys.

    krsort():reverse of ksort







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