Just ran into this annoying thing today:
Why does this /NOT/ work to remove NL's:
$AccNr = fgets($fp);
while ( !feof($fp) ) {
$AccNr = trim($AccNr); /// trim() DOES NOT WORK HERE
$InsertStr = "insert into $UpLoadTable values ('$AccNr')";
print "<pre>$i: Inserting: $InsertStr </pre>";
ob_flush();
mssql_query($InsertStr);
$AccNr = fgets($fp);
}
while this works just fine to remove NL's:
$AccNR = trim( fgets($fp) ); // trim WORKS JUST FINE HERE
while ( !feof($fp) ) {
$InsertStr = "insert into $UpLoadTable values ('$AccNr')";
print "<pre>$i: Inserting: $InsertStr </pre>";
ob_flush();
mssql_query($InsertStr);
$AccNr = trim( fgets($fp) ); // trim WORKS JUST FINE HERE
}
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php