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

Explain the difference b/w static and dynamic websites?

491


What is the output of the ucwords function in this example?

546


How to take a substring from a given string in php?

514


What is whitespace in php?

501


Code to upload a file in PHP?

551






How many types of functions are there in php?

592


How to track user logged out or not? When user is idle?

505


Is null empty php?

523


Explain me what is the goto statement useful for?

472


How to create and destroy cookies in php?

494


How can we create a database using php?

594


How do you end a session in php?

550


What is associative array in php?

530


Which function is used to read a file removing the html and php tags in it upwork?

482


What is difference between html and php?

493