Rather than using the ereg_ family of regular expression functions, I recommend you take a look at the preg_ family of regular expression functions.
This from the PHP online manual from the seciont introducing the ereg_ family of functions:
[tt]Note: PHP also supports regular expressions using a Perl-compatible syntax using the PCRE functions. Those functions support non-greedy matching, assertions, conditional subpatterns, and a number of other features not supported by the POSIX-extended regular expression syntax.[/tt] ______________________________________________________________________
Never forget that we are
made of the stuff of stars
rtrim($string);
or
$string=preg_replace("/\n/","",$string);
It relly depends on how th efile was created, windows (DOS) and UNIX do things differently. \n for windows and \l\r for unix files.
rtrim works well because it indiscriminately removes th efinal character of whitespace. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
It is, but I'm so used to SCO whatever rtrim should be the tool for the job, it's not let me down yet ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.