0

Hello everyone,
I've read, in the manual of PHP, about this function, i.e. quotemeta(string $str).
This function

Returns a version of str with a backslash character (\) before every character that is among these:
. \ + * ? [ ^ ] ( $ )

Now, I understand what it says, but I don't understand two things. First, where could this function be useful? And second, what are meta characters in PHP?
Thank you.

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Hani1991
0

Any strings like what? Would you please give me some example?

Edited by Hani1991: n/a

0

That function can help you protect from sql injection.
For example, if in your script enters $_POST and then put in a sql query you may protect many ways of hacking.
About sql inj: http://en.wikipedia.org/wiki/SQL_injection

Also this function can be useful in regular expressions.
Analog of this function is addslashes()

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.