Quote:
Originally Posted by qwe
hey ProG, anyway you can make me another simple script? to check for any empty lines and lines that start with 0-9 or some weird symbols (such as -,---,===,%---, etc, etc) and remove those lines ?  basically to remove any empty lines and lines that start with anything other then a valid character (a-z or A-Z)
|
if I understand what you are asking for, this will do it nicely:
Code:
<?php
if ( ( $file = file( "file.txt" ) ) !== false )
{
foreach( $file as $line )
{
if (ctype_alpha($line{0}))
{
echo $line . "<br>";
}
}
}
?>