Some general questions..

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Sun Mar 10, 2013 6:18 am

For #3:

Exceptions are in general a bit slower. They also consume more memory compared to custom error trapping code. If you think your code is slowing down then you can avoid using exceptions but exceptions are good in trapping logical errors.

johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Sun Mar 10, 2013 6:28 am

For #2:

For preventing sql injections use PDO and prepared statements. For simple html content, yes htmlspachars or strip_tags is ok but for not so simple html content it is better to use a lib like html purifier because filters are mostly validators than something that prevents injection.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests