Javatpoint Logo
Javatpoint Logo

PHP current() function

The current( ) function is an inbuilt function of PHP, and it is used to return the value of the current element in an array. This function was introduced in PHP 4.0.

Syntax

Parameters

Parameter Description Is compulsory
array Specifies the array to use. compulsory

Return Values

The current( ) function returns the value of the current element in an array or false on empty elements.

Example 1

Output:

javatpoint

Example 2

Output:

udemy

Example 3

Output:

udacity

Example 4

Output:

edureka





Help Others, Please Share

facebook twitter pinterest