Algorithms Arrays Passwords Uncategorized
Commerce Uncategorized
Databases Abstraction Layers Informix LDAP MS SQL MySQL ODBC PostgreSQL Uncategorized
Date & Time Calculators Conversion Translation Uncategorized
Discussion Chat Forums Guestbooks Polls Uncategorized
Email Validation Uncategorized
External Uncategorized
Files and Directories Uncategorized
Games Uncategorized
Graphics 3-D Graphs Resizing Thumbnails Uncategorized
HTML Forms Menus & Navigation Source Viewers Tables Templates Uncategorized
HTTP Authentication Cookies File Uploading Uncategorized
I18N Uncategorized
Math Uncategorized
Miscellaneous Uncategorized
Searching and Trees Uncategorized
Security Uncategorized
Text Uncategorized
Utilities Calendars Counters Link Checkers Weather Uncategorized
XML Uncategorized
| php sample source codes |
|---|
|
A function to encode an ugly-looking (query)string into a nicer-looking string (as defined, it looks like a barcode) and a function to decode the string back into the original string.
The 3 characters used for the encoding can be changed easily.
|
|
this is a handy tool to manage news headlines and messages for those, who do not have access to a database. all information is stored within a single file.
you can add, delete, modify and list all your news messages.
to include the headlines on your top page of your website, use the listALL() function. modify the zoomITEM() function to zoom your article.
|
|
Add Slashes to all fields submitted from a form. You could also run other functions over the fields.
|
|
nflector for pluralize and singularize English nouns.
This tool can help framework developers to create solutions based on naming conventions rather than on configurations.
It also provides helper functions that allow developers to transform text into and to "UpperCamelCase", "lowerCamelCase", "unserscored_words", "Header Title" or just "normal text".
This can be really useful for existing applications like Wiki, CMS, Forums, etc.. in order to allow them to create friendly URLs and change "WikiWords" inside their content to "Human text"
This Inflector was firstly is a port of Ruby on Rails Inflector.
It was ported to PHP for the Akelos Framework, a multilingual Ruby on Rails like framework for PHP that will be launched soon.
|
|
An Alternative to zip checker from this code gallery [ codex.php?id=991&single=1] which you can drop into any app with the DB already set up for you. Tests zip and allows you to punt with a default bad zip of 00000.
|
|
This function returns a string with all occurences of search in subject replaced with the given replace value.
|
|
isBlank is a function to determine if a string is really empty or not.
|
|
Cleans up a string. Changes certain characters into HTML compatable entities, removes many newlines, removes starting/trailing whitespace. removes multiple spaces. Finally, it makes it so users can't enter a stream of text to make the page's width screwy.
|
|
This code fragment takes a linux path and searches for \r\n into the specified files. It would then replace \r\n with \n.
The same logic could be extended to become a global search and replace as the code supports recusring into directories.
|
|
Cutting long size string
|
|
Adds the ability to flag a keyword so that it presents a link to it's definition.
|
|
Wrap text for e.g. textmails with a 72 wrap.
|
|
This function add HTML code to all urls in a string and return the string with clickable urls.
|
|
I have been looking high and low for a free dictionary. But no luck. So, the following .sql file is a dump of an English dictionary with three additional fields. One to describe if the word is a noun or verb, a soundex value and a metaphone value. Both soundex and metaphone functions and descriptions are available in PHP documentation.
|
|
A simple class that lets you use multiple functions to create custom filters.
|
|
This is a class that will format an array of scalars (like strings) neatly into an arbitrary number of equal sized columns. Uses an HTML table to do this, wrapping from left to right.
Modelled after the output from the format_page() SimulEfun in the Nightmare Mudlib.
|
|
This function prints out the contents of a varible replacing control codes ( \" \n \\ ) just like printf() does with a string literal.
|
|
Globally Searches and Replaces text in files throughout a directory.
|
|
This Function allows it to highlight assigned Parts (needle) of a string (hystack) with pre defined HTML-Tags by only once call of function.
Surely, in PHP4 it would be much easier to realise such a function - but this function works in PHP3, too.
To define the tags that highlight the needle in the hystack-string use an array consisting of two values [0] (for opening the tag(s)) and [1] (for closing the tag(s)).
The function doesn't do any echo's, it only returns the value, so you have to call it in order with echo to write what it returns.
|
|
This Function allows to highlight assigned case insensitive Parts (search) of a string (subject) with pre defined HTML-Tags
|
|
a very simple text counter but with an icon
|
|
Some simple functions to handle data for those wanting to write php console scripts with readline, with an example for adding colour to your scripts too.
|
|
This will return all the 256 characters with its valid char('value'); ...
|
|
Purpose?: Useful when you have PHP but no database ....
Features:
1) You can sort the table by clicking on the column headers
2) Add new member
3) Update existing member
Note: two pages included in the code example, make sure you split them.
|
|
I started playing around with ncurses in PHP with php 4.3.0.rc0 compiled with --with-ncurses and started noticing a huge lack of *any* documentation.. There are a lot of functions I write which could make good use of the functions as I write a lot of php shell scripts.
|
|
I previously wrote up a terminal color function which called perl to do the colorizing. This is more of an update, but is a totally different function. When provided with an additional variable it will output the colorization versus passing it back as a return variable.
|
|
Breaks a phone number string into country code, city code, number and dial trough. Takes many different formats.
|
|
Printer friendly pages from anywhere on a website.
This dynamic "Print This Page" script works right out of the box - cut and paste. Has the option to leave images in the new print friendly page if required. Just link to this script, and it will give a printer friendly version of any page, whether it's a PHP, ASP, CGI, or HTML page. Comes with a Cascading StyleSheet for further control of your print-friendly pages.
|
|
This package performs spell checking of text using only base PHP functions, thus without using specific spell check PHP extensions such as aspell or pspell.
The class uses a dictionary that is implemented as an array-based binary search table.
The binary search table declaration is saved to a file for speed and can be updated easily by the developer.
|
|
This simple script picks up random quotes from fortune's-like text files. Sentences are seperated by "%" char, fortune style database. The script could be used with any textfile, just watch out for the right needle and define()d include dir.
|
|
As the title implies, this is a random name generator, ported to PHP by me, was originally in C.
|
|
Chooses a random line of text from a list and displays it.
|
|
Simple reguler expression test page for both PHP and JavaScript.
Now it supports both ereg() and preg_match(). Changed JavaScript test result is look similar to PHP's test result. (It displays entire matched string for JavaScript RegEx)
It will be useful if you want to use the same regular expression to check form values both PHP and Client.
It's probably useful people who are learning regex also.
|