Re: [PHP4BETA] Feature Request
| From: | Teodor Cimpoesu | Date: | Mon, 23 Aug 1999 22:51:11 +0000 |
| Subject: | Re: [PHP4BETA] Feature Request | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3670@lists.php.net to get a copy of this message | ||
Scott Stevenson wrote:
>
> PHP3 has some really handy functions for dealing with strings, such as
> nl2br, htmlspecialchars, addslashes, chop, etc. Basically, things that can
> be accomplished with regular expressions, but are far more convenient and
> easy to use.
it was repeated for several times that regexp performs slower on
string(I would say
large strings) than these cute little functions under /string.functions
:)
> In a slightly different vein, it would be nice if there were some functions
> for dealing with form validation. First and foremost, this is important for
> security reasons. As far as I can tell, PHP doesn't have anything like
> Perl's -T option, and I'm a little concerned about what's coming down the
> pipe. Secondly, it would be nice to know if you're getting what you asked
> for.
you mean the `` stuff? just have those magic_quotes_gpc on.
> The functions would do things like search a string for a valid email
> address, valid phone number, or a zip/country code -- stripping out any
> potentially dangerous (or incorrect) characters. Ideally, this would work
> like:
>
> <form action="mail.phtml" method="post">
> <input type="text" name="email_addr">
> <input type="text" name="phone_num">
> <input type="zip" name="zip_code">
> </form>
>
> ------
>
> $cleanEmail = get_email($email_addr);
> $cleanPhone = get_phone($phone_num);
> $cleanZip = get_uszip($zip_code);
some pal posted on this list an announce of such a class to do this
kindof stuff.
Maybe he can do it again, as I missed it too.
These can be easily written, no need to be "native".
> A regex would be applied to find what you're looking for, and failing that,
> the function would return a false. Making this type of stuff into neat
> little functions makes it more accessible to newbies, and more elegant for
> normal users. It's sort of the "PHP way". :)
a formClass would be just as elegant as this.
> I'd do this myself, but I'm not fluent in C.
then try php, it's easier ;)
--
CIMPOESU Teodor, Web Programmer (h)
@ DIGICOM S.A. Bucharest, Romania
@ Internet, site development
@ teo@digiro.net, +(401)-330.47.28
official home page ~ http://www.digiro.net/
Internet web page ~ http://internet.digiro.net/