"Michael Fesser" wrote:[color=blue]
> .oO(William Krick)
>[color=green]
> >$records = explode("n", $mystring);
> >
> >However when I do this, the resulting $records array contains[/color]
> one[color=green]
> >extra empty element that I assume is caused by the final[/color]
> terminating[color=green]
> >'n'[/color]
>
> Correct.
>[color=green]
> >Is there some slick way to solve this problem?[/color]
>
> $records = explode("n", trim($mystring));
>
> Micha[/color]
do a preg_replace on the string (there are faster ways but this works
anyways)
$mystring = preg_replace("/\n$/", ’’, $mystring);
and then explode it.
--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL:
http://www.dbForumz.com/PHP-explode-...ict164939.html
Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbForumz.com/eform.php?p=552896