At 08:52 PM 1/17/2002 +0100, you wrote:
>Hi,
>
> > After typing the 16 characters in the htmlspecialchars() function 
> thousands
> > of times...
>
>When you have to type it 16 times, then you did something wrong.
>Consider this:

Apparently, you either I grossly mistyped what I wanted to say, or you 
misread it, or you never coded much in php.

>foreach($_GLOBAL as $key => $val)
>   $$key = htmlspecialchars($val);
>
>Replace $_GLOBAL by $_COOKIES, $_GET, .. OR you could just group
>together variables:
>
>   <input type="text" name="form[name]" ..>
>
>and go through $form in your script.

It has nothing to do with forms.  I handle forms in a very efficient, 
object oriented way.

> > I was wondering if it would be feasible to create an alias for this
> > function, say hsc() or something short.
>
> > [..]
>
> > It is no big deal, but for a function that is used ALL THE TIME, it would
> > be nice.
>
>why do something in C, when it can be done in PHP so nicely:
>
>function hsc(&$var) {
>   $var = htmlspecialchars($var);
>}

Maybe you ought to coding guidelines on zend.com which EXPLICITLY state 
that the above practice is BAD.

>Alias are terrible. The decrease readability of your code. Actually
>doing hsc() in PHP is compareable silly.

What I am trying to find out here is if it would be feasible to implement 
the alias in C, so there is not performance loss, and so it makes every 
ones lives just a little bit easier.


>Kind Regards,
>   Daniel Lorch
>--
>@echo "Hello, World";


Best Regards,
Jason Garber


-- 
PHP Development 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]

Reply via email to