Programmings Based On Array And String Functions To Merge The 2 Arrays, Then After Merge Convert Into String And Then Find Out The 1st And Last Word From The Reverse String
Programmings Based On Array And String Functions To Merge The 2 Arrays, Then After Merge Convert Into String And Then Find Out The 1st And Last Word From The Reverse String
Q1. Take 2 arrays then margin the arrays. After margin convert into string then reverse the string and find out 1st and last word from the reverse string.
Ans: Coding =>
Output Of The Coding =>
Explanation Of The Coding =>
Here my first output in the output page is of array merge where I have taken two arrays one is $arr1 and another is $arr2 and then I have merged this two arrays using array_merge() function.
Then my second output is in string where I have convert the array merge i.e. $arrmer into string by using implode() function.
Then my third output is of reverse string after converting the array into string I have reversed the string by using strrev() function.
Then my fourth output is of array that is to find the first and last word from the string I need to first convert the string into array using explode() function, which I have done in my fourth step.
Then my fifth output is of first word where I have finded out the first word from the reverse string using by array_shift() function.
Then my sixth output is of last word where I have finded out the last word from the reverse string by using array_pop() function.
Comments
Post a Comment