- 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
array_pop() function in PHP
The array_pop() function deletes the last element of an array. It returns the value of the last element of the array. If the array is empty, NULL is returned.
Syntax
array_pop(arr)
Parameters
- arr − The specified array
Return
The array_pop() function returns the last element of the array. If the array is empty, NULL is returned.
The following is an example −
Example
<?php $arr = array("laptop", "mobile", "tablet"); $res = array_pop($arr); print_r($res); ?>
Output
The following is the output −
tablet
Advertisements