View Single Post
Old 05-03-2009, 10:15 PM  
ProG
Confirmed User
 
Join Date: Apr 2009
Posts: 1,319
If you right click and View Source it will not be on one line. Otherwise, replace "\n" with "<br>" for html output.

Revised code to remove extra chars.

PHP Code:
<?php
if ( ( $file file"file.txt" ) ) !== false )
{
    foreach( 
$file as $line )
    {
        
$words explode" "trim$line ) );
        foreach( 
$words as $word )
        {
            
$word ereg_replace"[^A-Za-z0-9]"""$word );
            if ( 
strlen$word ) > )
            {
                echo 
$word "\n";
            }
        }
    }
}
?>
ProG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote