Hi Patrick,
@ 9:04:59 PM on 3/30/2001, Patrick Brown wrote:
...
> hostname|protocol|number|severity|description
> Each record is on it's own line and have the fields delimited by the pipe
> character |. The file may have thousands of records and I would like to
> bring them into a database for reporting.
...
> What function should I use and what would the syntax be?
Try explode().
<?php
/* this could be read in from a file instead, of course. */
$line = 'hostname|protocol|number|severity|description';
$parts = explode('|',$line); /* like perl's split. */
while(list(,$part) = each($parts))
{
/* do something with each $part */
...
}
?>
-Brian
--
PGP is spoken here: 0xE4D0C7C8
Please do not carbon copy me on list replies.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]