218 PHP Code Examples and References
Here are 218 excellent PHP Code Examples
and References at psoug.org. If you want to learn
the basics of PHP, then this PHP code library will help you greatly.
These code examples will also help you increase your PHP skills
and become a better PHP programmer. PHP-enabled web pages are
treated just like regular HTML pages and you can create and edit them
the same way you normally create regular HTML pages. Many pieces of
functionality are covered by these PHP code snippets.
PHP Coding Library:
- Add
& Subract dates
- Add
dashes to credit
card numbers
- Alternate
Title Case
function
- Anti-Flood
Protection
- Anti-SQL
Injection
Function
- Auto
Link Maker
- Auto
Link Maker #2
- Automatically
process
email
- Awesome
Date Time
Conversion Kit
- Bad
Word Filter
- Ban
Proxy Servers
- Base
64 Decode
- Basic
currency
conversion Convert 1 dollar to pounds using Yahoos conversion
- Basic
PHP Calendar
- Binary
to Text / Text
to Binary
- Block
IP Addresses
- Browser
sniffer /
detector
- Bubblesort
routine
- Buffered
Download code
- Build
Date Select
Boxes
- Build
select list from
table
- Build
select menu from
database
- Calculate
date of
Easter Sunday
- Calculate
Distance
- Calculate
Files In Directory
- Calculate
Zipcode Distances
- Calendar
for any month
any year
- CAPTCHA
w/ GD Image
Library
- Censor
Message Text
- Check
a file exists
- Check
if an image exists (GD)
- Check
if array is associative
- Check
If Domain Exists
- Check
number of characters in a range
- Check
syntax of multiple PHP files all at once
- Collapse
multiple spaces or dashes
- Combining
three arrays into one
- Combining
two arrays into one
- Convert
12 to 24 hour time and vice versa
- Convert
BBCode Tags
- Convert
Hours to Minutes
- Convert
HTML to plain text
- Convert
Minutes to Hours
- Convert
minutes to hours #1
- Convert
minutes to hours #2
- Cookie
Login Code
- Copy
File From Server
- Count
days between dates
- Count
lines in file
- Count
words in string
- Create
an HTML page on demand
- Create
Basic PDF
- Create
gzip file
- Create
mySQL table with PHP
- Create
thumbnails with PHP
- CSS
Colornames to RGB values
- Currency
display formatting function
- CyberCash
payment class
- Days
in month #1
- Days
in month #2
- De-Pluralize
a String
- Decimal
to octal conversion
- Define
a schedule of holidays
- Define
schedule of holidays
- Delete
all cookies set
- Delete
all files in directory...
- Delete
by date
- Delete
by wildcard
- Delete
files older than 'X'
- Detect
Mobile/WAP browser
- Directory
Listing
- Directory
Listing #2
- Display
html source with line numbers
- Display
stock quotes from a CSV file
- Download
File To Client
- Easy
page browser
- Echo
'n' number of words
- Email
attachments with PHP mail()
- Email
w/ attachments class
- Encrypt
and Decrypt without a known key
- EVAL a
file
- Export
table to Excel or MS Word file
- Extract
and Display all links on a web page
- Extract
Search Query from Referer
- Fake
email addresses
- Filter
Empty Array Elements
- Filter
non-alphanumeric characters
- Financial
management functions
- Find
days between dates #1
- Find
IP from Hostname
- Find
the current URL of the page
- Flat
file counter
- Forum
skeleton code
- FTP via
PHP
- GD
barchart demo
- Generate
random string
- Get
Absolute Path
- Get
All Files into an Array
- GET
and POST variables in hidden form
- Get
Atomic time
- Get
file extension
- Get
file in as variable
- Get
filesize without downloading
- Get
last added insert ID
- Get
Link Text
- Get
oldest file in directory
- Get
Path Info
- Get
text between tags
- Get
week number
- GoogleBot
monitor
- Gradient
Image Generator
- Graphical
tree like Explorer
- Handy
SORT BY box
- Heavy
Duty URL validator
- Heavy-duty
SendMail function
- HEX
Encode / Decode
- HEX
to RGB array
- Hierarchical
categories browser
- Highlight
Words #2
- How
many days ago
- How
to write a config file
- Import
SQL Data
- Improved
Strip_Tags()
- Insert
Into Middle Of Text
- Invert
Hex Color
- Invert
Hex Color #2
- IRC
Bot skeleton code
- Is
email deliverable?
- Is
Number Even?
- Language
Specific Response
- List
files in directory
- Live
validation of email address
- Make
grayscaled image
- Mini
private messaging system
- Mini-mail
/ Private Messaging system
- MKDIR
with error checking
- Month,
Day, Year dropdown boxes
- Nice
'Read More...' links
- Nicely
Format File Size
- Online
PHP Tester
- Optimize
All Database Tables (mySQL)
- Oracle
with PHP
- Ordinalize
(Suffix) Numbers
- Output
as Word Doc format
- Page
creation time
- Page
creation time #2
- Pagination
Example #1
- Pagination
Example #2
- Parse
RSS into array
- Pass
vars to/from Javascript
- Perfect
Highlighting Function
- Permutation
Generator
- PHP
to JavaScript Array
- Pick
Randomly from Array
- Prompt
user at command line
- Pronouncable
password generator
- Protect
Writable Directory
- Quick
calendar example
- Quickly
sort associative arrays
- Random
banner picker
- Random
Image from Directory
- Random
Pronounceable Passwords
- Read
gzip File
- Really
Get File Extension
- Recursive
Directory Browser
- Recursive
fopen()
function
- Recursive
function to generate a parent/child tree
- Recursively
traverse array
- Regex
Matching Patterns
- Remote
file_exist()
- Remove
all non-ASCII chars
- Remove
extra linebreaks
- Roman2dec
and Dec2Roman
- Rounded
random numbers
- Secure
Auto-Link Maker
- Select
(dropdown) list generator
- Server
Stats via PHP
- Set/Get/Remove
Cookies
- Show
current time as PNG-image
- Show
mySQL table as HTML
- Simple
Averaging
- Simple
DB connection class
- Simple
downloader script
- Simple
image scaling
- Sine,
Cosine, and Tangent
- Split
all chars in string
- Split
URL into parts #1
- Storing
images in a database
- String
to Date
- Strip
HTML to Text
- Super
Simple Database Driven Web Site
- Super
simple encryption example
- Super-mini
Chat room
- Ternary
Operator
- Test
If File Is Included
- Test
if mySQL table exists
- Text to
GIF
- Truncate
Links Over X Chars long
- Unique
Array function
- Unique
IP-icture
- Universal
parameter reading
- UNIX
Timestamp conversion
- Unset
unkown array element
- Update
MySQL Table Using An Array
- Use
htpasswd file with PHPscripts
- Use
SendMail
- Validate
credit card numbers
- Validate
email address #1
- Validate
email address #2
- Validate
email address #3
- Vulnerability
Tester
- WebServer
Spy
- Weighted
Random Choice
- What
Season Is It?
- Write
text onto an image
- Write
to File example
- XSS
Sanitizer Function
- Yahoo
Online Status
Popularity: 1% [?]
Related Posts:
Tags for this post>> PHP





























