- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
reset() function in PHP
The reset() function sets the internal pointer of an array to its first element. It returns the value of the first array element. It returns FALSE if the array is empty
Syntax
reset(arr)
Parameters
arr − The array to be used
Return
The reset() function returns the value of the first array element. It returns FALSE if the array is empty.
Example
The following is an example −
<?php $arr = array("one", "two","three", "four", ); echo current($arr); echo next($arr); echo next($arr); echo reset($arr); echo next($arr); ?>
Output
one two three one two
Advertisements