What purpose is foreach function in php?

1 answer

Answer

1060138

2026-09-05 20:15

+ Follow

foreach is a simple loop mostly used to read an array line by line;

$arr = array("one", "two" , "three");

foreach($arr as $c) {

echo $c;

}

it'll output : onetwothree

also try looking up the while loop

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.