Looking for somewhere to host your site? Browse our PHP web hosts section!

Welcome to Totally PHP, a growing PHP resource web portal for web developers intented to help with your PHP programming. We provide links to free PHP scripts, such as guestbooks, hit counters and more, and handy PHP code samples that you can use in your PHP and MySQL scripting. We also have tutorials, a large list of PHP links and much much more!

Most recently added Code Snippets

Verify an email address is in the valid format using filter_var
A simple function to let you check whether or not an email address is in the correct, valid format.
Calculate a PHP script's memory usage
Find out how much memory one of your PHP scripts uses when it runs.
Get the id of an auto_incrementing id from a mysql insert
Obtain the id of a newly added mysql row, without having to do another query.
Remove all characters except letters and numbers from a string
Strips any unwanted symbols from a string, leaving only letters and numbers.
Calculate VAT on a price and round to two decimal places
This function will calculate the UK VAT amount of 17.5% on a price and round it to 2 decimal places.
Check that characters in a variable are alpha numeric using ereg
Function to ensure a variable contains only letters and numbers.

Most recently added Scripts

Optimize tables in a MySQL database
This script will go through all the tables in a MySQL database and optimize each one.
Display a different image for each day of the week
This script will get the day of the week off the server and then display an image to match.
Random image
Displays a random image on a web page. Images are selected from a folder of your choice.
Password protect a page
Password protection for a single page. Visitors are required to enter a password and username into a login form to view the page content.
Random Quote
Displays a random quote on a web page. Quotes are picked from a list that you define.
Directory Lister
Displays a hyperlinked list of all the files contained in a specified folder.