PX : algorithms : strings

parent section: algorithms (0)

TitleAuthorRating Views Last Modified    
"In String" function 1 Greg Barton -- 20955 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.
Alphas 1.0 Patrick Clochesy -- 9256 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.)
books 0.1.1 Dirk Bartley -- 5010 2001-01-18 21:53:24 [ link ]
Personal library database. User interface to a postgres database of books in a home library.
Censoring messages in PHP 1.0 saifullah shafiq -- 5363 2003-09-26 10:03:01 [ link ] [ show ]
This small piece of code shows how to hide email addresses in your messages.
Character Functions 1.0 John -- 11878 1999-08-26 19:29:35 [ show ]
Ported from ctype.h. Functions like isalpha(), isdigit(), etc.
Cutting Text and Adding "..." 1.0 Allan Denot -- 9527 2000-05-08 15:40:02 [ show ]
Cut a very long text and add "..."
findstring 1.0 Jacob Ewing -- 5955 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.
FirstCaps 1.0 Cesar Rocha -- 7384 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.
getLeadingSentences 1.0 Jason Pitoniak -- 5025 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.
Information Container System sardonyx quinx -- 4880 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.
Limit words from long string 1.0 Johan Yusoff bin Abu Bakar -- 8815 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
maskEmail jan 3.0 6810 2003-01-20 03:42:21 [ show ]
Hide your email from crawlers
Multiple Stripslashes 1.0 Richard Heyes -- 8305 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.
NextPiece 0.1 julie -- 4651 2003-12-22 03:09:43 [ show ]
Get next piece of a string separated by delimiters.
num2word 1.0 Adam Trachtenberg -- 12708 1999-06-05 21:12:08 [ show ]
Compute English verbage from numerical values. (i.e. 1 becomes One.)
Password generator Hamish Milne -- 2544 2009-04-22 11:34:36 [ show ]
Generates a string of random keyboard characters
PHP4 string split function 1.0 John Asante Ntow -- 5433 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
Print Array 1.0 Scott Parish -- 12791 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.
Quote Changer 1.0 Brian -- 17118 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.
Random Link 1.00 Sascha Blansjaar -- 10555 1999-11-18 18:12:18 [ show ]
Random link takes an array with urls and description and displays them at random.
randomstring 0. Christopher Heschong -- 9750 1998-03-18 16:40:29 [ show ]
Generate a random string of n characters.
randomString 1.1 Colin Viebrock -- 9496 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.
search_for_repeats Greg Fowler -- 1006 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.
seperate_dups 1 Tony J. White -- 9735 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.
Simple Text Counter 0.1 Nooper -- 7716 2000-05-16 12:49:01 [ show ]
Simple counter in PHP4, 18 lines of code.
Simple Text Counter 0.2 Nooper -- 7988 2000-05-16 21:01:18 [ show ]
Small and tight text counter for webpages. 14 lines of code.
String Padding 1.0 Richard Heyes -- 8393 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.
String Query Navigation sardonyx quinx -- 4995 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.
Text Counter joe -- 10012 1999-11-29 09:07:35 [ link ] [ show ]
A simple text counter.. That does not do any command line stuffs..
Text Wrap 1.0 Brian Moon -- 10488 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.
textwrap 1.0 Richard Lynch -- 9357 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.
titleCase 1 Colin Viebrock -- 9886 1998-04-27 17:19:14 [ show ]
Converts a string to Title Case.
Translate characters to web safe codes 1.0 Marcus -- 3961 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.
Trim_Mid 1.0 Renato Lins -- 8829 1999-10-22 09:11:28 [ show ]
Nice Code to replace multiple ocorrencies from a string.
validateEmail 4.0 Frank Vogel -- 5895 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.
validateEmail 3.2 Jens W. Klein -- 4836 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.
validateEmailFormat 1.0 Clay Loveless -- 5183 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.
Word Wrap 1.0 Jeffrey D. Webster -- 11343 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.

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.