From: "Dan Joseph" <[EMAIL PROTECTED]> > I'm getting the following error: > > [Tue Nov 4 10:01:53 2003] [error] PHP Warning: split() [<a > href='http://www.php.net/function.split'>function.split</a>]: REG_EMPTY in > /usr/local/apache/htdocs-chm/import_data.php on line 26 > > Here is the code in question: > > $line = fgets( $file ); > > echo $line . "<br>"; > > list ( $ACTION_DESCR, > $LOAN_NUMBER, > $BORROWER, > $CO_BORROWER, > $ADDRESS, > $CITY, > $STATE, > $ZIP, > $ABANUM, > $BANKACCTTYPE, > $BANKACCTNUM, > $ADD_PRINCIPAL, > $DAYS_TRANSFER, > $FILE_NAME, > $DATE_CREATED ) = split( "|", $line );
The | character is a special character in regular expressions, which split() expects. So, you can use split("\|",$line) which escapes the | character. Although, since you're not really using a regular expression, you'd be better off (more efficient) to just use explode('|',$line) and have the same effect. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php