Web >> Development >> PHP >> How to read line by line from a text file

<body> <?php $menufile = "webdevmenu.txt"; if ( file_exists($menufile) ) { $lines = file($menufile); foreach ($lines as $linetext) { echo "$linetext<br>\n"; } } ?> </body> </html>