trim(strip_tags(mysql_real_escape_string())) or.....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kryles
Forum Contributor
Posts: 114
Joined: Fri Feb 01, 2008 7:52 am

trim(strip_tags(mysql_real_escape_string())) or.....

Post by kryles »

Does it make a difference which order you put the three functions?

trim()
strip_tags()

and mysql_real_escape_string() ?

I was working on old code and doing it as

Code: Select all

 
trim(strip_tags(mysql_real_escape_string($_POST['blah ']))) 
 
and then saw an older copy where I was doing

Code: Select all

mysql_real_escape_string(strip_tags(trim($_POST['blah'])))
just wondering if one is safer than the other for some reason or any order is same result

Thanks,
Post Reply