Category Archives: PHP

Configure xdebug for PHP

The xdebug extension can be found pre-compiled for windows, linux and OS X systems. http://code.activestate.com/komodo/remotedebugging/ Edit your PHP.ini file to enable the xdebug extension. Under windows: [xdebug] zend_extension=C:\software\php-5.3.2\ext\php_xdebug.dll

Posted in PHP | Tagged , , | Leave a comment

Convert PHP unix timestamp to a MySQL date format

In PHP: $mysqldate = date( ‘Y-m-d H:i:s’, $unixdate ); $unixdate = strtotime( $mysqldate ); In the MySQL query: $query = "UPDATE table SET datetimefield = FROM_UNIXTIME($phpdate) WHERE…"; $query = "SELECT UNIX_TIMESTAMP(datetimefield) FROM table WHERE…";

Posted in PHP | Tagged , | Leave a comment

Disable PHP in a directory

To prevent PHP scripts from executing in a directory add this code to an .htaccess file <Directory "/path/to/my/sfProject/web/uploads"> php_flag engine off </Directory>

Posted in PHP | Tagged , , | Leave a comment

PHP email validation

Link to the google code project for email address validation. http://code.google.com/p/php-email-address-validation/ Checkout the code with subversion svn checkout http://php-email-address-validation.googlecode.com/svn/trunk/ php-email-address-validation-read-only

Posted in PHP | Tagged , , | Leave a comment