How can I reset an array in PHP?

Answer Posted / ram

The reset () function moves the internal pointer to the
first element of the array. This function returns the value
of the first element in the array on success, or FALSE on
failure.
Syntax: reset(array)

<?php
echo date("Y-m-d");
$people = array("Prasad", "Ram", "vidhya");

echo current($people) . "<br />";
echo next($people) . "<br />";

echo reset($people);
?>

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to find a specific value in an array?

511


What are the advantages and disadvantages of cascade style sheets?

672


What are php libraries?

500


Why laravel is the best php framework in 2019?

521


What is the use of session and cookies in php?

530






Where sessions stored in PHP?

544


What are php filters?

522


What is difference between mysqli and mysql?

536


How do I know my xampp version?

518


What is the advantage of runtime polymorphism?

511


Difference between array_combine and array_merge?

529


What is php simple definition?

539


How many data types are used by php?

515


What is the main difference between require() and include()?

478


How to get a random value from a php array?

551