PHP examples (example source code) Organized by topic

PHP
1. Chart
2. Class
3. Components
4. Cookie Session
5. Data Structure
6. Data Type
7. Date
8. Design Patterns
9. Development
10. DNS
11. Email
12. File Directory
13. Form
14. Functions
15. Graphics Image
16. HTML
17. Language Basics
18. Login Authentication
19. Math
20. MySQL Database
21. Network
22. Operator
23. PDF
24. Reflection
25. Statement
26. String
27. Utility Function
28. Web Services SOAP WSDL
29. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
PHP 
Form
Login Authentication
HTML
XML
Form
File Upload( 5 ) Form Action( 1 ) Form based Email( 2 ) Form Based Query( 1 ) Form Checkbox( 5 ) Form Data( 10 ) 
Form Post( 8 ) Form Select( 14 ) Form TextArea( 1 ) Form Validation( 7 ) Form( 10 ) Hidden Field( 3 ) 
is_uploaded_file( 2 ) Query String( 5 ) Radio Button( 3 ) Self Call Form( 2 ) TextBox( 4 ) urlencode( 1 ) 
_GET( 4 ) _POST( 7 ) _SERVER( 9 ) 
Login Authentication
Authentication( 1 ) Browser Password Dialog( 2 ) Cookie based Login( 1 ) File Based Authentication( 1 ) ID Generate( 1 ) Login Form( 8 ) 
md5( 3 ) User Registration( 2 ) 
HTML
Authentication( 17 ) Content Types( 1 ) get_html_translation_table( 3 ) get_meta_tags( 1 ) header( 15 ) headers_sent( 1 ) 
HTML Cohabitation( 2 ) HTML File( 1 ) HTML Font( 2 ) HTML String( 3 ) HTML Table( 4 ) HTML( 10 ) 
htmlentities( 6 ) htmlspecialchars( 4 ) html_entity_decode( 1 ) http_build_query( 1 ) HTTP_REFERER( 1 ) HTTP_Request( 1 ) 
HTTP_USER_AGENT( 6 ) Hyperlink( 1 ) PATH_INFO( 1 ) rawurldecode( 2 ) REMOTE_ADDR( 1 ) Table Utilities( 2 ) 
tidy_clean_repair( 1 ) tidy_parse_file( 4 ) tidy_parse_string( 3 ) Web Color( 1 ) _FILES( 2 ) 
XML
DOM Edit( 1 ) DomDocument( 20 ) domxml_xslt_stylesheet_file( 1 ) mcrypt_create_iv( 1 ) mcrypt_encrypt( 1 ) RSS( 1 ) 
SAX( 3 ) simplexml_load_string( 16 ) var_dump( 3 ) var_export( 1 ) XML Attributes( 1 ) XML Content( 2 ) 
XML DOM Tree( 1 ) XML File Read( 3 ) XML Handler( 3 ) XML Path( 2 ) XML Transformation( 2 ) XML Validation( 1 ) 
xpath( 9 ) XSLTProcessor( 4 ) xslt_process( 1 ) 
MySQL Database
Cookie Session
File Directory
MySQL Database
Choose Database( 1 ) Database Connection( 2 ) Database Create( 1 ) Database Delete( 2 ) Database Insert( 3 ) Database MetaData( 6 ) 
Database Query( 5 ) Database Update( 3 ) DBM( 3 ) MySQL Connection( 4 ) MySQL Processes( 1 ) mysqli( 14 ) 
mysqli_autocommit( 1 ) mysqli_connect( 5 ) mysqli_error( 1 ) mysqli_fetch_array( 2 ) mysqli_prepare( 1 ) mysql_affected_row( 1 ) 
mysql_close( 2 ) mysql_connect( 5 ) mysql_db_query( 2 ) mysql_drop_db( 1 ) mysql_fetch_array( 7 ) mysql_fetch_assoc( 1 ) 
mysql_fetch_field( 1 ) mysql_fetch_row( 2 ) mysql_field_name( 1 ) mysql_field_table( 1 ) mysql_field_type( 1 ) mysql_list_processes( 1 ) 
mysql_list_tables( 2 ) mysql_num_fields( 2 ) mysql_num_rows( 5 ) mysql_query( 9 ) mysql_real_escape_string( 1 ) mysql_result( 3 ) 
mysql_select_db( 6 ) mysql_stat( 1 ) mysql_tablename( 2 ) mysql_unbuffered_query( 1 ) odbc_close( 1 ) odbc_connect( 2 ) 
odbc_exec( 1 ) odbc_execute( 1 ) odbc_free_result( 1 ) odbc_prepare( 1 ) odbc_result_all( 1 ) Query Result( 9 ) 
SQL String( 1 ) sqlite database( 4 ) sqlite_array_query( 1 ) sqlite_column( 1 ) sqlite_create_function( 1 ) sqlite_current( 1 ) 
sqlite_fetch_array( 2 ) sqlite_fetch_column_types( 1 ) sqlite_fetch_single( 1 ) sqlite_field_name( 1 ) sqlite_has_more( 1 ) sqlite_num_fields( 1 ) 
sqlite_num_rows( 1 ) sqlite_popen( 1 ) sqlite_query( 3 ) sqlite_seek( 2 ) sql_regcase( 1 ) Table Column( 2 ) 
Table Create( 4 ) Table Database( 2 ) Table MetaData( 5 ) 
Cookie Session
Cookie( 4 ) Session Encode( 1 ) Session ID( 1 ) Session Start( 1 ) Session Variables Create( 2 ) Session Variables Delete( 2 ) 
Session Variables Modify( 1 ) Session Variables Register( 2 ) Session Variables Unregister( 1 ) Session Variables( 10 ) session_decode( 1 ) session_destroy( 3 ) 
session_encode( 1 ) session_id( 3 ) session_is_registered( 1 ) session_register( 1 ) session_set_save_handler( 1 ) session_start( 6 ) 
setcookie( 15 ) _COOKIE( 7 ) _SESSION( 14 ) 
File Directory
basename( 2 ) chgrp( 1 ) chmod( 4 ) chown( 1 ) copy( 5 ) CSV File( 9 ) 
Directory Create Delete( 3 ) Directory( 9 ) dirname( 2 ) Disk Drive( 3 ) disk_free_space( 1 ) disk_total_space( 1 ) 
fclose( 2 ) feof( 4 ) fflush( 1 ) fgetc( 2 ) fgets( 10 ) fgetss( 3 ) 
File Close( 1 ) File Copy Move( 2 ) File Delete( 1 ) File Exist( 1 ) file function( 3 ) File Lock( 1 ) 
File Open( 1 ) File Property( 17 ) File Read( 7 ) File Seek( 1 ) File Upload( 5 ) File Write( 3 ) 
File( 3 ) fileatime( 2 ) filectime( 2 ) filegroup( 1 ) filemtime( 3 ) fileowner( 2 ) 
fileperms( 1 ) filesize( 3 ) file_exists( 5 ) file_get_contents( 9 ) file_put_contents( 3 ) flock( 4 ) 
fopen( 22 ) fputs( 4 ) fread( 6 ) fscanf( 3 ) fseek( 3 ) fsockopen( 7 ) 
fwrite( 7 ) getcwd( 1 ) getlastmod( 5 ) glob( 3 ) is_dir( 4 ) is_executable( 2 ) 
is_file( 2 ) is_link( 1 ) is_readable( 3 ) is_writable( 3 ) mkdir( 2 ) move_uploaded_file( 1 ) 
opendir( 2 ) Path( 1 ) pathinfo( 2 ) popen( 9 ) readdir( 3 ) readfile( 2 ) 
readlink( 1 ) realpath( 2 ) rename( 3 ) rewind( 1 ) rmdir( 1 ) scandir( 3 ) 
stat( 4 ) Stream Context( 1 ) Stream Filter( 2 ) stream_filter_append( 1 ) symlink( 3 ) tempnam( 1 ) 
Temporary file( 3 ) Text File Read( 8 ) Text File Write( 2 ) Text File( 1 ) touch( 3 ) unlink( 8 ) 
virtual( 1 ) _FILE( 2 ) __LINE( 2 ) 
Email
Math
String
Utility Function
Email
Email Address( 1 ) Email Validation( 2 ) mail function( 5 ) 
Math
abs( 3 ) acos( 1 ) asin( 1 ) atan( 1 ) base_convert( 3 ) BCMath( 2 ) 
ceil( 1 ) cos( 1 ) decbin( 2 ) dechex( 1 ) decoct( 1 ) define( 3 ) 
deg2rad( 2 ) exp( 1 ) floor( 1 ) getrandmax( 1 ) hexdec( 1 ) log( 3 ) 
Math Functions( 8 ) Math( 5 ) max( 1 ) min( 1 ) mt_getrandmax( 1 ) mt_rand( 10 ) 
pow( 3 ) rad2deg( 1 ) rand( 5 ) Random( 2 ) round( 3 ) Scientific Notation( 1 ) 
sin( 1 ) sqrt( 1 ) tan( 1 ) 
String
addslashes( 1 ) chdir( 1 ) chop( 1 ) chr( 1 ) count_chars( 2 ) curl_init( 2 ) 
Email Format( 3 ) ereg( 6 ) eregi( 4 ) ereg_replace( 6 ) gmp_strval( 1 ) here document( 5 ) 
is_string( 1 ) levenshtein( 1 ) ltrim( 3 ) metaphone( 1 ) New Line( 1 ) ord( 1 ) 
preg_grep( 4 ) preg_match( 33 ) preg_match_all( 15 ) preg_quote( 1 ) preg_replace( 23 ) preg_replace_callback( 3 ) 
preg_split( 10 ) Quotation( 8 ) Regular Expressions( 38 ) Replace( 2 ) rtrim( 2 ) similar_text( 2 ) 
soundex( 3 ) split( 4 ) sprintf( 9 ) strcasecmp( 4 ) strcmp( 5 ) strcspn( 4 ) 
String Case( 5 ) String Compare( 5 ) String Concatenation( 6 ) String Contains( 1 ) String Count( 2 ) String Escape( 4 ) 
String Find( 2 ) String Interpolation( 5 ) String Length( 2 ) String Matches( 8 ) String Operators( 2 ) String Pad( 2 ) 
String Repeat( 1 ) String Replace( 7 ) String Split( 2 ) String Token( 5 ) String Trim Chop( 6 ) String( 17 ) 
stripslashes( 1 ) strip_tags( 8 ) stristr( 2 ) strlen( 6 ) strpos( 2 ) strrev( 4 ) 
strrpos( 12 ) strspn( 4 ) strstr( 6 ) strtok( 4 ) strtolower( 5 ) strtotime( 12 ) 
strtoupper( 7 ) strval( 2 ) str_ireplace( 2 ) str_pad( 9 ) str_replace( 11 ) str_split( 1 ) 
str_word_count( 3 ) Sub string( 9 ) substr( 23 ) substr_count( 4 ) substr_replace( 7 ) trim( 4 ) 
ucfirst( 4 ) ucwords( 7 ) wordwrap( 7 ) 
Utility Function
apache_note( 2 ) argv( 2 ) base64_decode( 1 ) connection_status( 1 ) curl_setopt( 1 ) dl( 1 ) 
echo( 11 ) escapeshellarg( 1 ) escapeshellcmd( 4 ) eval( 1 ) exec( 3 ) exit( 2 ) 
getenv( 1 ) get_browser( 1 ) get_extension_funcs( 1 ) get_loaded_extensions( 1 ) hash( 1 ) ignore_user_abort( 1 ) 
include( 6 ) include_once( 3 ) ini_get( 2 ) ini_get_all( 3 ) ini_set( 1 ) list( 4 ) 
mail( 14 ) mcrypt_encrypt( 2 ) mcrypt_enc_get_iv_size( 1 ) mcrypt_enc_get_key_size( 1 ) md5( 8 ) mhash( 2 ) 
nl2br( 5 ) ob_start( 2 ) output_add_rewrite_var( 1 ) output_reset_rewrite_vars( 1 ) pack( 2 ) parse_ini_file( 1 ) 
parse_str( 2 ) passthru( 4 ) PEAR( 3 ) phpinfo( 1 ) print( 9 ) printf( 28 ) 
print_r( 2 ) putenv( 2 ) range( 5 ) register_shutdown_function( 2 ) require( 2 ) require_once( 1 ) 
serialize( 4 ) setlocale( 11 ) set_time_limit( 1 ) sha1( 3 ) shell_exec( 2 ) shmop Functions( 2 ) 
sleep( 1 ) SWFMovie( 2 ) system( 4 ) umask( 1 ) uniqid( 3 ) unserialize( 3 ) 
usleep( 1 ) WDDX( 2 ) _ENV( 4 ) 
Graphics Image
Components
Chart
Graphics Image
Arc( 1 ) Circle( 2 ) Draw String( 5 ) Ellipse( 3 ) Font( 1 ) Image Color( 3 ) 
Image Create( 1 ) Image Font( 2 ) Image Paint( 1 ) imagearc( 2 ) imagecolorallocate( 3 ) imagecolorallocatealpha( 1 ) 
imagecolorexact( 1 ) imagecolortransparent( 3 ) imagecopymerge( 1 ) imagecopyresized( 1 ) imagecreatefromgif( 1 ) imagecreatefromjpeg( 2 ) 
imagecreatefrompng( 3 ) imagecreatetruecolor( 1 ) imagedeallocate( 1 ) imageellipse( 1 ) imagefill( 1 ) imagefilledarc( 3 ) 
imagefilledellipse( 2 ) imagefilledpolygon( 2 ) imagefilledrectangle( 4 ) imagefilltoborder( 1 ) imagefilter( 7 ) imagegif( 1 ) 
imageinterlace( 1 ) imagejpeg( 3 ) imageline( 1 ) imagepng( 2 ) imagepolygon( 1 ) imageRectangle( 1 ) 
imagesetbrush( 2 ) imagesetpixel( 1 ) imagesetstyle( 1 ) imagesettile( 1 ) imagestring( 1 ) imagettfbbox( 3 ) 
imagettftext( 4 ) imagetypes( 1 ) image_type_to_mime_type( 1 ) JPG Image( 2 ) Line( 3 ) Paint String( 1 ) 
Rectangle( 2 ) Round Rectangle( 1 ) Text Align( 1 ) Transparent( 1 ) Triangler( 1 ) TrueType Fonts( 2 ) 
Water Mark( 1 ) 
Components
Feedback Form( 1 ) Page Counter( 2 ) Registration Form( 1 ) 
Chart
Bar Chart( 1 ) Pie Chart( 1 ) 
Class
Design Patterns
Class
Abstract Class( 5 ) Class Constant Property( 3 ) Class Constructor( 1 ) Class Definition( 14 ) Class Inheritance( 5 ) Class Instance( 1 ) 
Class Method( 13 ) Class Property( 10 ) Class Static Properties( 1 ) clone( 7 ) const( 5 ) Constructor( 15 ) 
Destructors( 7 ) extends( 1 ) final( 5 ) Getter Setter( 3 ) Inheritance( 14 ) instance of( 2 ) 
Interface( 7 ) Method Override( 4 ) Object Attribute( 2 ) object( 1 ) Objects( 8 ) private( 8 ) 
Properties get( 1 ) Properties set( 2 ) protected( 5 ) public( 5 ) Reflection Class Definition( 8 ) Reflection Class Hiearchy( 2 ) 
Reflection Class Methods( 9 ) Reflection Constructor( 1 ) Reflection Existance( 2 ) Reflection Invoke( 2 ) self( 1 ) static properties( 5 ) 
this( 4 ) toString( 1 ) __autoload( 5 ) __call( 3 ) __clone( 2 ) __get( 3 ) 
__set( 1 ) __sleep( 2 ) __toString( 3 ) __wakeup( 2 ) 
Design Patterns
Composite Pattern( 1 ) Decorator Pattern( 1 ) Factory Pattern( 1 ) Request Info( 4 ) Singleton Pattern( 2 ) Strategy Pattern( 1 ) 
Language Basics
Development
Data Structure
Functions
Language Basics
Assertion( 2 ) Comments( 11 ) Constant( 1 ) Define Constant( 1 ) Exit( 1 ) Global( 3 ) 
GLOBALS( 8 ) Include( 4 ) instanceof( 2 ) Modulus( 1 ) Php Functions( 5 ) Php Script( 15 ) 
Php Tag( 5 ) phpcredits( 1 ) PNG( 2 ) Polygon( 1 ) Pre Defined Constant( 2 ) Reference( 4 ) 
static variables( 5 ) Static( 2 ) Variable Reference( 6 ) Variable Scope( 11 ) Variable Set Unset( 5 ) Variable Type( 3 ) 
Variables( 11 ) 
Development
Apache( 1 ) Client Info( 5 ) CSV( 4 ) date function( 2 ) Date Time( 9 ) Debug( 1 ) 
Echo( 7 ) Error Obtrusive Messages( 1 ) Error Report( 1 ) Exceptions( 2 ) Explode implode( 5 ) GET POST( 1 ) 
getdate( 12 ) HTTP_POST_VARS( 1 ) I18N Locale( 2 ) include path( 1 ) list( 2 ) max_execution_time( 1 ) 
mktime( 1 ) Number Format( 3 ) Php Environment( 4 ) Print( 6 ) Printf( 20 ) print_r( 3 ) 
Query String( 3 ) Server Info( 3 ) sprintf( 5 ) System Command( 9 ) System Log( 1 ) Your own Exceptions( 1 ) 
Data Structure
Array Element( 17 ) Array Function( 33 ) Array Index( 5 ) Array List( 1 ) Array Loop( 11 ) Array range( 3 ) 
Array sort( 30 ) array( 15 ) array_chunk( 1 ) array_combine( 2 ) array_count_values( 3 ) array_diff( 3 ) 
array_diff_assoc( 1 ) array_filter( 5 ) array_flip( 5 ) array_insert( 2 ) array_intersect( 5 ) array_keys( 4 ) 
array_key_exists( 4 ) array_map( 3 ) array_merge( 9 ) array_merge_recursive( 1 ) array_multisort( 2 ) array_pad( 9 ) 
array_pop( 3 ) array_push( 6 ) array_rand( 3 ) array_remove( 2 ) array_reverse( 5 ) array_search( 1 ) 
array_shift( 4 ) array_slice( 3 ) array_splice( 9 ) array_sum( 2 ) array_unique( 3 ) array_unshift( 4 ) 
array_values( 4 ) array_walk( 3 ) arsort( 4 ) asort( 6 ) Associate Array( 30 ) compact( 1 ) 
count( 4 ) each( 2 ) explode( 10 ) extract( 8 ) implode( 9 ) in_array( 5 ) 
is_array( 1 ) krsort( 2 ) kshuffle( 1 ) Multidimensional Array( 14 ) Nested Array( 1 ) reset( 1 ) 
rsort( 2 ) shuffle( 3 ) sizeof( 1 ) Stack( 4 ) unpack( 2 ) usort( 2 ) 
Functions
call_user_func( 1 ) create_function( 2 ) Definition( 19 ) Dynamic Function( 11 ) Function Recursion( 6 ) function_exists( 2 ) 
func_get_args( 1 ) func_num_args( 3 ) is_callable( 1 ) Nested Functions( 1 ) Override( 2 ) Parameters( 24 ) 
Return Value( 18 ) 
Statement
Reflection
Operator
Data Type
Date
Statement
break statement( 9 ) continue( 6 ) do while( 8 ) Exception( 4 ) for loop( 24 ) foreach( 10 ) 
If statement( 24 ) switch statement( 13 ) throw( 1 ) While loop( 11 ) 
Reflection
class_exists( 2 ) class_implements( 1 ) class_parents( 1 ) gettype( 2 ) get_class( 1 ) get_class_methods( 2 ) 
get_class_vars( 1 ) get_declared_classes( 2 ) get_declared_interfaces( 2 ) get_object_vars( 2 ) get_parent_class( 1 ) interface_exists( 1 ) 
is_a( 2 ) is_float( 1 ) is_int( 1 ) is_numeric( 2 ) is_string( 2 ) method_exists( 1 ) 
ReflectionClass( 1 ) 
Operator
Arithmetic Operators( 18 ) Assignment Operators( 4 ) Bitwise Operators( 3 ) Boolean Operators( 1 ) Comparison Operators( 10 ) Conditional Operator( 4 ) 
Logical Operators( 15 ) Operator Precedence( 5 ) 
Data Type
Binary Number( 2 ) boolean( 4 ) Casting( 16 ) Char( 2 ) ctype_digit( 1 ) Data Type( 9 ) 
empty( 1 ) Float( 19 ) floatval( 1 ) Hexadecimal Number( 2 ) Integer( 21 ) intval( 3 ) 
isset( 5 ) money_format( 2 ) number_format( 8 ) Octal Number( 2 ) settype( 2 ) unset( 6 ) 
var_dump( 1 ) 
Date
cal_from_jd( 1 ) cal_to_jd( 3 ) checkdate( 2 ) date( 26 ) date_default_timezone_set( 2 ) getdate( 6 ) 
getservbyname( 2 ) getservbyport( 2 ) gettimeofday( 1 ) gmmktime( 3 ) gmstrftime( 2 ) localtime( 5 ) 
microtime( 2 ) mktime( 10 ) strftime( 19 ) time( 4 ) 
Network
DNS
Web Services SOAP WSDL
PDF
Network
checkdnsrr( 2 ) DNS Validation( 1 ) DNS( 4 ) dns_get_record( 2 ) Domain Name( 1 ) FTP Functions( 7 ) 
getmxrr( 1 ) getprotobyname( 1 ) getprotobynumber( 1 ) IP Address( 1 ) openssl_public_encrypt( 1 ) Port( 1 ) 
SOAP Client( 2 ) SOAP Server( 3 ) Socket( 4 ) socket_create( 4 ) socket_create_listen( 1 ) stream_get_line( 1 ) 
stream_socket_server( 1 ) URL Encoding( 1 ) URL Redirect( 2 ) URL Validation( 1 ) wddx_deserialize( 1 ) wddx_packet_start( 1 ) 
wddx_serialize_value( 1 ) 
DNS
DNS Functions( 5 ) dns_get_mx( 1 ) dns_get_record( 2 ) gethostbyaddr( 2 ) gethostbynamel( 2 ) 
Web Services SOAP WSDL
SOAP Message( 1 ) SOAP Response( 1 ) WSDL( 1 ) 
PDF
Pdf Lib( 3 ) pdf_findfont( 1 ) pdf_new( 2 ) pdf_place_image( 1 ) 
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.