Proper Paragraphs
13
This little function will split an e-mail address passed to it at the @ sign, and make sure that there is a valid e-mail server at the other end =)
9
Generates an 88 character secure hash string for the passed in strings.
5
Returns an array of folder/file names in the specified path.
26
This is a simple function to generate a random ID of letters and numbers however long you want. All you do is pass it how many parts you want and then how many pieces(chars/numbers) per part you want.
I hope you enjoy
I hope you enjoy
15
Generates a tree view within a dropdown select box.
12
Generates select boxes, text boxes, check boxes and radio buttons. Via a handful of functions.
7
The modus operandi for this is similar to that taken by PHP's implementation of such functions. It's comparitively memory-intensive, but is much faster than running a whole bunch of tests.
Basically, you set a mask -- an array of 256 null bytes -- and set those that correspond to characters you wish to trim. Then, rather than having to test if a character is in the set of characters to trim(O(n), or linear time on *ws), you just test once (O(1), or unit time) to see if the byte in question is set.
And of course, to trim(), you just wrap trim() around both ltrim() and rtrim().
One point of caution: these functions trim in place, so copy strings before trimming them. (Of course, if you usually want access to both pre- and post-trimmed strings, you could always make these malloc() a new string and return a pointer to it . . . )
Basically, you set a mask -- an array of 256 null bytes -- and set those that correspond to characters you wish to trim. Then, rather than having to test if a character is in the set of characters to trim(O(n), or linear time on *ws), you just test once (O(1), or unit time) to see if the byte in question is set.
And of course, to trim(), you just wrap trim() around both ltrim() and rtrim().
One point of caution: these functions trim in place, so copy strings before trimming them. (Of course, if you usually want access to both pre- and post-trimmed strings, you could always make these malloc() a new string and return a pointer to it . . . )
7
Turns any string backwards. If you input "Test" it gives out "tseT". Hope it's useful.
The snippet shows how to use it.
The snippet shows how to use it.
-11
This is a faily simple function to validate a URL being passed into your scripts. It will allow for http, https, and ftp. The beginning www. of a URL is optional as well. It will also validate if you have an IP address in place of the domain name. I'm sure this can be improved upon as this is my first attempt at regular expressions but it has worked good for me so far. Please comment or improve if your able.
Thanks!
Thanks!
12
Similar to Perl's CGI::escapeHTML(), though (because we can!) this adds it as a method to all String objects.









