about 9 years ago
Hi Reader's,
Welcome to FindNerd, today we are going to discuss the use of reset() function in php ?
So, basically The reset() function moves the internal pointer to the first element of the array.
syntax of reset() function
array parameter is required.
you can take reference of below example:
- <?php
- //here define a variable of array
- $Emp_name = array("Joe", "Roy", "Jorden", "Scott");
- //here call reset() function and print
- echo reset($Emp_name);
- ?>
<?php //here define a variable of array $Emp_name = array("Joe", "Roy", "Jorden", "Scott"); //here call reset() function and print echo reset($Emp_name); ?>
The above example output will be:
0 Comment(s)