1. Question:Why substr() is used?

     

    Answer
    The substr () function is used to return the part of a string located between a predefined starting offset and length position.







    1. Report
  2. Question:Why explode() is used?

     

    Answer
    The explode () function is used divides the string into an array of substrings.







    1. Report
  3. Question:What is object cloning?

     

    Answer
    To remedy the problems with copying, PHP offers an explicit means for cloning an object is known as object cloning. We can clone an object by preprefacing with the clone keyword.






    1. Report
  4. Question: Difference between array_merge() and array_slice()?

     

    Answer
    The array_merge() function merges one ore more arrays into one array. This function returns one array with the elements of all the parameter arrays.

    Syntax is array_merge(array1,array2,array3...)
    The array_slice () function returns a section of an array based on a starting and ending offset value.
    Syntax is array_slice(array,start,length,preserve)







    1. Report
  5. Question:Which functions are used to add and remove array elements? 

    Answer
    There are four functions used to add to and remove from array elements. these are-

    1. array_unshift():function adds element to the front of the array.
    2. array_push(): function adds element to the end of an array.
    3. array_shift(): function removes and returns the first item found in an array.
    4. array_pop():function removes and returns the last element from an array.






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