Mail-id verification: /^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/ Though both can be used in PHP and JS but there is another method to verify an email-id in PHP, by using the below code if(!filter_var($email, FILTER_VALIDATE_EMAIL)) FILTER_VALIDATE_EMAIL is a predefined filter in PHP. Name Verification: /^[A-Za-z .’-]+$/ Phone Verification: /^[0-9 -]+$/ Removing all spaces: $pattern = ‘/\s+/’; $replace = “”; $string… Continue reading Some Useful Regex
Category: PHP
Secure Upload Folders
There are two ways to prevent execution of any (malicious) scripts uploaded to by users. Method one – like described in this post. Method two – add the below code to .htaccess file of the directory that needs to be protected. RemoveHandler .cgi .php .php3 .php4 .php5 .phtml .pl .py .pyc .pyo .sh .html .shtml… Continue reading Secure Upload Folders
PHP executing rm -f -r dirname through exec
Google Trends on PHP Frameworks
PHP Microframeworks
Below is a list of some PHP Microframeworks Epiphany Flight Fat Free Silex Slim BulletPHP Limonade Phalcon Recess PHP Tonic Wave Framework Zaphpa Though all have their own merits and demerits but Phalcon is the most recommended one for speed and Slim and Flight for ease and speedy learning. In general Slim seems to be… Continue reading PHP Microframeworks