+ 5
What is foreach loop?
2 Answers
+ 7
thank you
+ 2
Example:
$read = file('names.txt');
foreach ($read as $line) {
echo $line .", ";
}
For example, if you have a file and you want to read every single line. And then you want to echo it out into world. $read is the file and $line is every line. You also can use it for arrays.
Maybe this could help you.