Php Class Snippets

To create the formatter paste this code into a new file and name it sfWidgetFormSchemaFormatterDefList.class.php. I saved it in /lib but it also makes sense to put it in /lib/form, depending on your personal preference.

14 February, 2011   

You'll need a of copy Simple Pie for the include right at the top here.

30 January, 2011   

Applying Even/Odd Classes

This is a PHP Class that calculates the size, number of files & folders of a specific directory.

23 October, 2012   

MySQL code example for sorting data in a GRID

13 April, 2013   

Load and store classes for easy use and re-usability using advanced PHP object storing.

05 April, 2014   

PHP code to take web screenshots. You can get your application key and secret by registering at

11 July, 2013   

Help manage mysql database common task

01 October, 2013   

This php code for mail someone from your code

13 February, 2013   

Place line numbers in text output format using CSS and PHP

Example source code for function pointer to member function of class

C++ code snippet for function pointer to member function of class

14 May, 2014   

Html Code example for hCalendar

06 June, 2012   

This function highlight_string() outputs or returns a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP.

By default Symfony displays forms in tables, with each new input being a table row. If you want to display your forms more semantically with fieldsets and lists, Symfony has a list formatter built in. You can tell an individual form to display as a list using the code below.

When creating a new object, pass the initial variables as an array. Then use this code to quickly assign the array vars to the class vars. This will mean importing large arrays into the object in three lines of code.

06 May, 2013   

Code example for Month Day Year Dropdown

27 October, 2011   

An example to include another PHP file into a PHP script

05 August, 2014   

PHP code example to highlight words in a string.

29 October, 2011   

Here shown an example how to Compress CSS with PHP