|
Posted by Michael Fesser on 05/30/07 10:42
..oO(e_matthes@hotmail.com)
>I would still really like to know, however, why my local php
>installation and the installation on my shared server interpret this
>line differently:
>$regExp = "/^[a-zA-Z0-9_\- ]\{$minLength,$maxLength}/";
>
>My understanding is that the backslash tells php to escape the
>following open brace. It seems to do that locally, but not on the
>shared server. Any reason why the behavior is different on the two
>systems?
Different PHP versions? From the manual:
| Again, if you try to escape any other character, the backslash will be
| printed too! Before PHP 5.1.1, backslash in \{$var} hasn't been
| printed.
and
| Since you can't escape '{', [...]
I would use sprintf() as suggested by Toby.
Micha
Navigation:
[Reply to this message]
|