PX : algorithms : strings

parent section: algorithms (0)

TitleAuthorRating Views Last Modified    
"In String" function 1 Greg Barton -- 20835 1998-04-13 12:30:46 [ show ]
This function returns the position of string s1 within string s2. The position is 1 based. If s1 is not in s2, 0 is returned.
Quote Changer 1.0 Brian -- 16947 2000-03-25 14:47:39 [ link ] [ show ]
This is a little script that allows you to put a quote on your page and easily change it using a PHP script. I developed this script on Windows NT but it should work fine on any Linux or Unix system.
Print Array 1.0 Scott Parish -- 12668 1999-08-23 15:24:44 [ show ]
Print Array is most useful as a debugging function, when you want to see the exact structure contained within a variable.
num2word 1.0 Adam Trachtenberg -- 12502 1999-06-05 21:12:08 [ show ]
Compute English verbage from numerical values. (i.e. 1 becomes One.)
Character Functions 1.0 John -- 11743 1999-08-26 19:29:35 [ show ]
Ported from ctype.h. Functions like isalpha(), isdigit(), etc.
Word Wrap 1.0 Jeffrey D. Webster -- 11230 1999-08-07 18:14:11 [ show ]
Performs a word wrap on an arbitrary length string of characters. Allows inlining of quotations files without regard to lack of formatting.
Random Link 1.00 Sascha Blansjaar -- 10438 1999-11-18 18:12:18 [ show ]
Random link takes an array with urls and description and displays them at random.
Text Wrap 1.0 Brian Moon -- 10362 2000-04-13 14:57:34 [ show ]
This function will wrap text correctly in all known cases. Other functions have trouble with the break string being in the string itself.
Text Counter joe -- 9912 1999-11-29 09:07:35 [ link ] [ show ]
A simple text counter.. That does not do any command line stuffs..
titleCase 1 Colin Viebrock -- 9742 1998-04-27 17:19:14 [ show ]
Converts a string to Title Case.
randomstring 0. Christopher Heschong -- 9639 1998-03-18 16:40:29 [ show ]
Generate a random string of n characters.
seperate_dups 1 Tony J. White -- 9616 1999-07-29 18:47:25 [ show ]
Seperates an array into two arrays. One that contains everything from the original array minus duplicate values. The other is all the elements that were duplicate values.
Cutting Text and Adding "..." 1.0 Allan Denot -- 9434 2000-05-08 15:40:02 [ show ]
Cut a very long text and add "..."
randomString 1.1 Colin Viebrock -- 9385 1998-05-14 13:19:52 [ show ]
A slightly improved version of Christopher Heschong's code. This creates a random string of x characters, using a defined string of possible characters.
textwrap 1.0 Richard Lynch -- 9255 1998-07-10 15:48:59 [ show ]
Wraps text to any desired width with customizable line break. Defaults are 80 columns and '<BR>\n' Should be trivial to work in 2.0.1 Remove optional arguments to start.
Alphas 1.0 Patrick Clochesy -- 9159 2000-03-06 00:07:25 [ link ]
Creates an array of alpha (letters). Creates either A-Z or a-z depending on the value of $set (read comments.)
Trim_Mid 1.0 Renato Lins -- 8727 1999-10-22 09:11:28 [ show ]
Nice Code to replace multiple ocorrencies from a string.
Limit words from long string 1.0 Johan Yusoff bin Abu Bakar -- 8707 2000-04-20 15:56:41 [ show ]
This code will help you to limit long strings to a certain number just to give the reader the whole idea of a longtext string variable
String Padding 1.0 Richard Heyes -- 8225 2000-04-21 06:45:12 [ show ]
String padding function. Determines the longest item in an enumerated array and pads the rest out to that length with whatever character you specify. Can optionally pad out to a specific length.
Multiple Stripslashes 1.0 Richard Heyes -- 8202 2000-07-30 13:30:23 [ show ]
Got bored one day writing line after line of stripslashes for form data, so I wrote this. Simply pass it the names of all the variables you want slashes stripped from (comma seperated and in the global scope) and it will sort those bad buggers out.
Simple Text Counter 0.2 Nooper -- 7888 2000-05-16 21:01:18 [ show ]
Small and tight text counter for webpages. 14 lines of code.
Simple Text Counter 0.1 Nooper -- 7622 2000-05-16 12:49:01 [ show ]
Simple counter in PHP4, 18 lines of code.
FirstCaps 1.0 Cesar Rocha -- 7279 2000-09-26 06:46:23 [ show ]
This code converts any string with the first caracter of each word to uppercase, such as UCWORDS function, but it remains the prepositions lowercase. It's useful for names of persons and cities in some languages, like mine, Portuguese and others.
maskEmail jan 3.0 6673 2003-01-20 03:42:21 [ show ]
Hide your email from crawlers
findstring 1.0 Jacob Ewing -- 5837 2002-12-01 12:49:51 [ show ]
A short, simple function that finds the first occurance of the substring $search within the string $text. If $mode is equal to zero, it will return the starting position of the substring. Otherwise, it will return the position of the character that comes after the substing. Returns -1 if the substring is not found.
validateEmail 4.0 Frank Vogel -- 5779 2001-01-02 10:20:09 [ show ]
This version fixes some problems which occur with some mail addresses (e.g. ???@aol.com). Because it uses some new functions, PHP v4.0.4 is required.
PHP4 string split function 1.0 John Asante Ntow -- 5295 2005-07-12 23:30:47 [ show ]
Quick, dirty and effective version of the PHP5 function 'str_split()'. Comes in handy when you want to turn a string into an array of characters. Tested in PHP 4.3
Censoring messages in PHP 1.0 saifullah shafiq -- 5246 2003-09-26 10:03:01 [ link ] [ show ]
This small piece of code shows how to hide email addresses in your messages.
validateEmailFormat 1.0 Clay Loveless -- 5065 2002-03-12 00:51:10 [ link ] [ show ]
PHP translation of Jeffrey E.F. Friedel's email validation masterpiece from O'Reilly's _Mastering Regular Expressions_. Hopefully the last word on the email validation discussion.
getLeadingSentences 1.0 Jason Pitoniak -- 4928 2001-01-24 10:20:13 [ show ]
Takes a string and returns the specified number of sentences from the beginning of it. Useful for displaying a partial description on a search results page, etc.
books 0.1.1 Dirk Bartley -- 4913 2001-01-18 21:53:24 [ link ]
Personal library database. User interface to a postgres database of books in a home library.
String Query Navigation sardonyx quinx -- 4888 2003-09-18 22:45:21 [ link ] [ show ]
Using a string and a simple condition statement to navigate with all your pages is the best strategy in backend technology. With this session, a user will be able to understand how simple it is to compare string with other strings using the address bar or the anchor tag itself.
Information Container System sardonyx quinx -- 4766 2003-09-18 22:43:08 [ link ] [ show ]
Before starting a huge PHP related online projects, you should consider using a strategy that will be accesible, readable and maintainable with your other team mates. And one of this strategy is using one php file that contains all of your vital data and information. This strategy can be compared to a double-edged sword and there is a big chance of being attacked by harmful persons if not used properly. So it's up to the user whether to adopt this kind of strategy or not. Here are the following variables you can fill up, modify and used continously with all your PHP documents. Just don't forget to use the include() function as one of the starting headers for your documents.
validateEmail 3.2 Jens W. Klein -- 4723 2001-09-29 05:59:46 [ show ]
This version of validateEmail() looks not only in TLD for MX _records_, also in sub-domains. Its necassary for adresses like someone@uibk.ac.at.
NextPiece 0.1 julie -- 4546 2003-12-22 03:09:43 [ show ]
Get next piece of a string separated by delimiters.
Translate characters to web safe codes 1.0 Marcus -- 3816 2006-06-30 06:03:43 [ link ] [ show ]
Free online tool, converts entered characters into the equivalent ASCII codes, as usable with HTML. The output can be used directly on web pages, so useful where special characters are required.
Password generator Hamish Milne -- 2444 2009-04-22 11:34:36 [ show ]
Generates a string of random keyboard characters
search_for_repeats Greg Fowler -- 908 2013-05-27 19:01:17 [ show ]
Search a text file for repeated words. Outputs (in p tags) the first discovered repeated word in the file if there are any, and "no words were repeated" if there aren't any.

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.