Php Backup Snippets


04 March, 2012   

The for loop is used when you know in advance how many times the script should run.

16 November, 2014   

Useful php code to see if the current file is being included or run directly.

14 August, 2012   

PHP code to validate email

This example code showing how to use PHP Functions to clean User Input

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.

Have you ever wanted to know how much memory one of your PHP scripts uses when it runs? You might want this information if your script has a memory leak or takes a long time to execute. If that's the case then there's a great built-in function called memory_get_usage, which will display the exact amount of memory being used by your script. This...

02 June, 2011   

This will check an email, to see if it is in a valid format.

13 April, 2011   

Connecting to a MySQL database to make the data from the database available in your Web application, can be done in many different ways. Here are two often used methods.

26 December, 2012   

This cron will do the same on Windows as session management works on Linux

27 April, 2013   

PHP code for Fast Triangular Numbers

Code example using PHP to add/ remove nodes from an XML file

01 April, 2015   

PHP code example for using the array_walk function to format an array.

02 June, 2012   

This code removes all special characters from the given URL and make it SEO friendly.

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.

12 January, 2014   

How to get the visitor IP using the $_SERVER['REMOTE_ADDR'] variable.

HTML Form using php code that accepts mail related information

You may use this code to highlight specific words in your displaying search results.

05 August, 2014   

PHP code example to highlight words in a string.

16 November, 2013   

You can use this function when you correct a iban number in your commercial projects.

As an example, here we are redirecting http://www.yoursite.com/product.php?id=231&category=seo to http://www.yoursite.com/seo/newpage.htm