View Single Post
Old 05-04-2009, 12:58 AM  
d-null
. . .
 
d-null's Avatar
 
Industry Role:
Join Date: Apr 2007
Location: NY
Posts: 13,724
Quote:
Originally Posted by qwe View Post
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>"; 
             
        } 
    } 
} 
?>
__________________

__________________

Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
Check out the #1 WordPress SEO Plugin: CyberSEO Suite
d-null is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote