Web >> Development >> PHP >> How to skip a line starting with certain characters

<body><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <?php $menufile = "webdevmenu.txt"; if ( file_exists($menufile) ) { $lines = file($menufile); foreach ($lines as $linetext) { if( !preg_match('/^#/',$linetext) ) { echo "$linetext<br>\n"; } } } ?> </body> </html>