View Single Post
Old 09-20-2010, 05:56 PM  
Varius
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
Quote:
Originally Posted by Tempest View Post
Agreed with the single quotes.. Far too much code out there that uses double quotes.

As for the int thing, let's all argue about how best to handle them lol...

I actually do a preg_match on all values that are supposed to be pure integers so I can catch invalid data. i.e.:

preg_match('/^[+-]?\d+$/', (string)$value)
Speaking of preg_match, to everyone out there not using the latest version yet, if you have been using ereg you need to stop and start using preg_match, as ereg has become deprecated.

same goes for the split() function, which is very common across people's code so better off with explode in most cases.
__________________
Skype variuscr - Email varius AT gmail
Varius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote