A
A
Alexander Sharomet2014-04-15 15:53:31
PHP
Alexander Sharomet, 2014-04-15 15:53:31

How to escape url PHP PDO mySql?

I have this code:

$url=filter_var($url,FILTER_SANITIZE_URL);
$url=explode('/',$url);

$url is an array, how do I check for forbidden characters like ' " ^ in short, escape?
mysql_real_escape_string - doesn't work with PDO
Or can I just replace these characters with str_replace? I just don't know how to do it right.
Thanks!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
1
1001001 111, 2014-04-15
@sharomet

www.php.net/manual/en/pdo.quote.php

G
gro, 2014-04-15
@gro

A well-formulated question is half the solution.
Why You Need It?

R
Rsa97, 2014-04-15
@Rsa97

Use parameterized queries

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question