![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
prev() function in PHP
The prev() function rewinds the internal array pointer. It outputs the previous element in the array.
Syntax
prev(arr)
Parameters
arr − The specified array. Required.
Return
The pos() function returns the value of the previous element in an array.
Example
The following is an example −
<?php $arr = array("one", "two"); echo pos($arr); echo next($arr); echo prev($arr); ?>
Output
one two one
Advertisements