Re: quotemeta() question...
| From: | Jason Barnett | Date: | Fri, 11 Feb 2005 21:41:33 +0000 |
| Subject: | Re: quotemeta() question... | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-208566@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
...
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Well in the example above it was a single quote, not a double quote. But either way... I would have thought there would be a 1:1 relationship in the quotemeta translation (either quote all of them, or assume they are all quoted already).thats correct... echo "\\"; // shows one backslashA better example code would be: $string = 'period.backslash\\plus+star*question?lbracket[rbracket]carat^lparen(rparen)dollar$'; echo "<PRE>", quotemeta($string), "</PRE>";Interesting aside... with the test string above, I noticed that backslash\\ only resolved to two backslashes. I thought there would be
See above. I would think (given my own common sense as well as the man page for quotemeta) that there would be a quote added to each of these. But the results don't quite match this... -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://www.php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins4. It seems that quotemeta will resolve \ and \\ to \\, \\\ and \\\\ resolve to \\\\, etc.
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc