
- Forum
- Programming Talk
- PHP
- How can I reset an array in PHP?
How can I reset an array in PHP?
This is a discussion on How can I reset an array in PHP? within the PHP forums, part of the Programming Talk category; Sometimes if you are moving through the various elements in an array, you will want to return the pointer to ...
-
How can I reset an array in PHP?
Sometimes if you are moving through the various elements in an array, you will want to return the pointer to the beginning of the array.This is easily done with the reset function.
-
rachelpit,
"reset" function will return the value of the first array element.
You can reset your array by making use of PHP reset() function as shown below
reset(<<array_name>>) ;
Please Note that "reset" function will not clear the contents of the array, It will only move the internal pointer to the first element of the array.
-
I've been stydying a little PHP recently and I can agree with lokeshm on this post.
-
Sponsored Ads

Reply With Quote





