Php > Code Snippets
A daily MySQL row displayed
A simple class
Display A to Z links on your site
Add data to a MySQL database
Atomic time
Backup a folder to a zip file
Basic currency conversion
This function allows you to input your image , the percentage you wish
Bubblesort routine
Calculate VAT on a price and round to two decimal places
Check a file exists
Check if an image exists using GD
Check number of characters in a range
Check that characters in a variable are alpha numeric using ereg
Connect to a MySQL database
Convert links into clickable hyperlinks
Cool GD effect
Count and display the number of rows in a mysql database table
Count characters in a sentence
Count number of words in a text string
Count the number of lines in a text file
Count the number of rows ina MySQL database
Count words in a sentence
Requires a file called counter1.dat in the same folder as the script
Create a database
Create a date with mktime
Create a MySQL database from PHP
Create a random password
Creating a table in a MySQL database
Date and time example
Some date and time examples
Decimal to binary conversion
Decimal to hexadecimal conversion
Decimal to octal conversion
Degrees / Radians conversions
Delete data from a MySQL database
Display a random entry from aMySQL database
Display an Access database using PHP and ODBC
Display html source with line numbers
This uses the get_meta_tags function to display the meta tags of a given
Display MySQL database rows alphabetically
Display mysql server information
Display rows from only a certain category of a MySQL database
Display meta tags from another site
Display stock quotes from a CSV file, in this case Microsoft
DIsplay the content type of a file with PHP and cURL
Displays month, day and year
Display the date a page last modified
Display the dimensions of an image using the GD library
Display the time
Display when a page was last modified on your site
Display width and height of image
Display x amount of links from a MySQL database
Displays all files in the directory that the script resides
A Do While loop example in PHP
Get the IP address corresponding to a given Internet host name
Download a web page to a file using cURL
Email verify function
Encrypt a password
Extract a zip file to a folder
File exists with PHP and Java
File size function
Find a string in another
Display all links on a web page
Find and replace words in a text string using str_replace
For loop syntax in PHP
Free disk space
Check whether the GD library exists or is installed
Generate a random password
Get current url using PHP_SELF
How to display stock quotes on your website using Yahoo quotes
Get the connection time with PHP and cURL
Gethostbyaddr function returns the name of the host specified by
Gethostbyname function returns the IP address of the host specified by its name
Getprotobyname function returns the number associated with a protocol.
Getservbyport function returns the name of the service that uses a specified port
This example shows how you can get the length of a string , this uses
GIF creation with PHP
Grab a web page with cURL
A nice graph effect
Hexadecimal to decimal conversion
HTML special characters
This is an If Else statement example
A resizing example that keeps the aspect ratio of the image intact
Get users IP address
Gets the Internet host name corresponding to a given IP address
Java version with php
Latest stock market information
List all your MySql databases
List all databases on a server
List all files in a directory and place them in a select menu
Lottery number generator
Mozilla or Internet explorer
Displays the mysql version in use
Number of days between now and a day in the future
Is a number odd or even
Open a zip file and display file information
Add zeroes to the front of a number
Display the date a page was last accessed
Page load time
Page redirect
PHP and cURL example
Php and java example
Shows the value of PI
Populate a select menu from a MySQL database
Display users processor information
This example will display a different background color for each day of the week
Spam bots love looking for email addresses, give them a helping hand
This example uses an array to store images and then produces a random
Generate random letters
This shows how to generate random numbers
Random password generator
Generates a random string from an array of characters
Random title
Reading RSS feeds with PEAR xml_rss package
Remove all characters except letters and numbers from a string
Remove whitespace from a text string using the PHP trim function
Another resizing an image example
Function sorts an array in the reverse order
Find a pattern in a text file
This example shows how to search and replace on a string
Send email using the PHP mail() function
Displays lots of server information
Shorten a text string
This displays all tables in a MySQL database, enter your own database
This is a simple email form example
This is a simpler version of our metatag generator and only generates
Simple quote of the month
Size of a webpage with PHP and cURL
Display latest news from Slashdot
Split a file into path info
Splitting a string
Status code of a web pagewith PHP and cURL
Lookup the symbol for a company
System uptime using php_w32api.dll functions
Display the latest news from the register on your site
This backups index.php to a gzip file
This example shows some simple browser detection
This is a currency convertor which allows a user to get the latest currency
This is the next step in the directory file viewer , allowing your users to
A greeting based upon the time of day
Time to load page example
A clock that updates
Use ereg to check that characters in a variable only contain letters
Same as before but the user chooses the quotes they wish to see
This shows how to use the trim function to remove white spaces
This example checks whether a link is valid or not
Validate an email address using regular expressions
Verify using ereg that characters in a variable only contain numbers
Visitor information
Displays the type of image
A while loop example in PHP
Word wrap
Write data to a text file
Latest news from Yahoo news
- Algorithms
- Arrays
- Authentication
- Calendar
- Code Snippets
- Programs
- Content Manage
- Contest Related
- Cookies
- Credit Cards
- DBase Related
- Databases
- Date Time
- Directories
- E-Mail
- Errors
- File
- File System
- Forms
- Handling
- Graphics
- HTML and PHP
- Informix
- Ingres
- InterBase
- LDAP
- Look and Feel
- Miscellaneous
- MySQL
- Other
- PHP Classes
- Searching
- Navigation
- Statistics
- Strings
- User Manage