10 && strpos( $output, '' ) !== false ) { return true; } return false; } $lines = file( 'search.txt' ); foreach( $lines as $line ) { $url = str_replace( array( "\n", "\r", "\t" ), '', $line ); if( checkurl( $url ) ) { echo $url.' is up'; } else { echo $url.' is down'; } } ?>