Re: echo'ing a variable and cat'ing text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Nichel wrote:
Well, you're not telling fgets how much to read for one, and I'd do this a different way to begin with...

if ( $file = file ( $filename ) ) {
    foreach ( $file as $line ) {
        if ( $file != "" ) {
            echo ( $line . "@mdah.state.ms.us" );
        }
    }
} else {
    echo ( "Couldn't open $filename" );
}

When I do that, I get:

userabc
@mdah.state.ms.ususerdef
@mdah.state.ms.ususerxyz
@mdah.state.ms.us


so looks like I need to strip out the end-of-line (EOL) character somehow.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux