Full Concepts On array_reverse() Function Along With A Coding Example Prepared By Me Of Array Functions In PHP

Full Concepts On array_reverse() Function Along With A Coding Example Prepared By Me Of Array Functions In PHP

Q1. Why the array elements are not reversed while using "array_reverse($arr);"?

Ans: The array elements are not reversed while using array_reverse($arr) because after manipulation it's not able to store anywhere, but the array_reverse() function is working.

Q2. Why in other functions manipulation is working and output is generated while in "array_reverse($arr)" manipulation is not working and output is not reversed?

Ans: In other functions manipulation is working and output is generated while in "array_reverse($arr)" manipulation is not working and output is not reversed because in other functions we are either adding or deleting the array elements where in adding the array elements it is fixed while in deleting the array elements we are terminating the array elements , so there is nothing to store after manipulation, but in array_reverse() function we need to store the array elements.

Q3. Give a coding example of array_reverse()?

Ans: Coding =>

<?php
$arr=["red","green","blue"];
$arrrev=array_reverse($arr);
print_r($arrrev);
?>

Output Of The Coding =>





 


Comments

Popular posts from this blog

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

PHP WEB DEVELOPMENT INTERVIEW QUESTIONS ASKED IN APOLLO HOSPITAL ALONG WITH MY OWN CONCEPTS AND MY OWN EXPLANATION ANSWERS(PART - 1) REST OF THE QUESTIONS AND ANSWERS WILL BE PREPARED BY ME IN MY NEXT BLOG

Mini Project On Multi User CRUD Operations(Create, Read, Update & Delete) Of Donar Details Of Indian Nationals Who Donate To Ramkrishna Math, Belur Math Using PDO (PHP Data Objects) With Proper Explanation Of Each And Every Individual Line Of The Code Of connection.php Page, form.php Page, formaction.php Page, admin_display.php Page, client_display.php Page, edit.php Page, editaction.php Page And delet.php Page (Here You Will Find The Image Of Sayang Sri Ramkrishna Dev, Sayang Sri Ma Sarada Devi & Sayang Sri Swami Vivekananda) In My CRUD Operation