PHP Snippet Db software and script
get current filename as variable get current filename as variable script allows you to get just the filename of the current script, without the path.
Price: $GPL, Rating: 10, Downloads: 266
Download
get current page URL get current page URL - Useful when a PHP script needs to call itself
Price: $GPL, Rating: 8, Downloads: 981
Download
foreach loop foreach loop - simple php example of a for-each loop, useful for iterating over lists and objects arrays.
Price: $GPL, Rating: 8, Downloads: 573
Download
check if a file or directory exists check if a file or directory exists - To determine whether a file exists on the server, PHP has a simple function: file_exists().
Price: $GPL, Rating: 10, Downloads: 528
Download
send email send email script allows you to send an email from PHP.
Price: $GPL, Rating: 8, Downloads: 186
Download
get first character in a string get first character in a string - Return the first character in a string
Price: $GPL, Rating: 8, Downloads: 664
Download
switch strings switch strings script is a switch example using strings.
Price: $GPL, Rating: 10, Downloads: 234
Download
redirect browser redirect browser - Using the php header function, a browser can be redirected to another page.
Price: $GPL, Rating: 6, Downloads: 353
Download
extract numbers from string extract numbers from string script using ereg_replace allows you to replace selective numbers from a string.
Price: $GPL, Rating: 7, Downloads: 257
Download
define a Constant define a Constant script shows you how to define constants in PHP.
Price: $GPL, Rating: 6, Downloads: 537
Download
safely display quotes and other special characters safely display quotes and other special characters script uses the htmlspecialchars() command to convert all special characters in a string to
Price: $GPL, Rating: 7, Downloads: 295
Download
for loop - simple for loop - simple script is the for loop - basic control structure.
Price: $GPL, Rating: 7, Downloads: 698
Download
include a file with error reporting include a file with error reporting allows you to be able to give some feedback if a PHP include has failed.
Price: $GPL, Rating: 8, Downloads: 353
Download
Truncate String Function Truncate String Function - uses strlen() to truncate a long string and return a shortened version.
Price: $GPL, Rating: 7, Downloads: 533
Download
read file to a string read file to a string script reads a text file to a string variable using fgets.
Price: $GPL, Rating: 10, Downloads: 241
Download
switch integers switch integers - php switch example
Price: $GPL, Rating: 8, Downloads: 312
Download
disable php sessid in URL disable php sessid in URL disables php from rewriting URLs to add a phpsessid, and forces the use of cookie sessions instead.
Price: $GPL, Rating: 6, Downloads: 993
Download
show referring URL show referring URL grabs the referring URL, get the HTTP_REFERER and save it to a variable.
Price: $, Rating: 8, Downloads: 674
Download
count number of words in a string count number of words in a string - Count the number of elements in a string using the count() and explode() commands.
Price: $GPL, Rating: 5, Downloads: 548
Download
format date to mysql datetime format date to mysql datetime allows you to convert the current date and time to MySQL datetime format using PHP's date() function.
Price: $, Rating: 6.5, Downloads: 386
Download
create array from comma separated list create array from comma separated list script uses the PHP Explode() command to create an array from a comma separated list.
Price: $GPL, Rating: 9, Downloads: 529
Download
format numbers format numbers script offers an easy function for displaying formatted numbers.
Price: $GPL, Rating: 7, Downloads: 591
Download
Upload File Upload File - Simple example that shows how to upload a file using PHP.
Price: $GPL, Rating: 6, Downloads: 426
Download
random number random number - Generate a random number using mt_rand
Price: $GPL, Rating: 10, Downloads: 198
Download
write string to file write string to file script allows you to write string variable to a text file.
Price: $GPL, Rating: 8, Downloads: 379
Download
convert string to uppercase capitals convert string to uppercase capitals - PHP provides a simple function to convert all letters to uppercase / captials: strtoupper();
Price: $GPL, Rating: 8, Downloads: 766
Download
ban block IP addresses ban block IP addresses gets the users IP address and exits the page if it matches a banned number.
Price: $, Rating: 7, Downloads: 316
Download
date and time formatting date and time formatting introduces a function that returns a formatted string showing date, time and/or seconds.
Price: $GPL, Rating: 9, Downloads: 917
Download
simple form handling simple form handling shows a very simple form together with the form handling process on a single page.
Price: $GPL, Rating: 7, Downloads: 657
Download
return directory component return directory component allows to find the directory componenet of a filename using the PHP function dirname().
Price: $GPL, Rating: 6, Downloads: 738
Download
disable PHP Timeout disable PHP Timeout script allows you to override the php timeout with the set_time_limit() command.
Price: $GPL, Rating: 9, Downloads: 1416
Download
ImageThumb ImageThumb is a small piece of software written in the PHP language that lets you create thumbnails on the fly for a given image, whether it is local or remote.
Price: $GPL, Rating: 8, Downloads: 263
Download
simple email validation simple email validation script validates an email address and returns TRUE or FALSE.
Price: $, Rating: 8, Downloads: 451
Download
form action detect form post form action detect form post script provides you a way to process a php form.
Price: $GPL, Rating: 9, Downloads: 1564
Download
array declaration array declaration script demonstrates a simple php array declaration.
Price: $GPL, Rating: 7, Downloads: 517
Download
passing variables via url passing variables via url - Pass variables to a page using the question mark
Price: $GPL, Rating: 7, Downloads: 825
Download
detect referer detect referer script uses php to detect referrer and process accordingly.
Price: $GPL, Rating: 7, Downloads: 660
Download
strip leading comma from a string strip leading comma from a string removes the leading comma (if there is one)from a string using the ltrim command.
Price: $GPL, Rating: 6, Downloads: 317
Download
read file to array read file to array - This simple PHP example shows how to read a text file into an array, with each line of the file as a separate element.
Price: $GPL, Rating: 10, Downloads: 569
Download
if else example if else example is a basic example of an if then else control structure.
Price: $GPL, Rating: 8, Downloads: 618
Download
find string find string - Search and detect the presence of a string inside another string using the strpos() command.
Price: $GPL, Rating: 7, Downloads: 648
Download
search array find in array search array find in array script searches an array to find a specific value.
Price: $GPL, Rating: 10, Downloads: 288
Download
extract filename from a full path string extract filename from a full path string easily returns the filename component of a path with the built-in PHP basename() function.
Price: $GPL, Rating: 6, Downloads: 561
Download