In below example will have 4 arrays and will be nested. Below example will break 2 which means that it will go back to Loop B. In order to go back to Loop A , will be break 3. break 4 will stop the everything, which means it won’t loop anymore $array1 = array(‘1′,’2′,’3′,’4’); $array2 […]
Rerun an array even if the loop will change the array elements
I have this problem where i will need to loop an array but while looping it , i will add elements into array and i need to loop that data as well. Below are an example that you can do so:- $array = array(‘1′,’1.5′,’3′,’5′,’7’); $count = count($array); for($i=0; $i