Results 1 to 1 of 1

Thread: Common Library

  1. #1
    Join Date
    Jun 2003

    Common Library

    I have created what I call a common library. A set of functions that is more of an extension of shortcuts and new functions that I think php should of included. I plan to add more later and plan to maintain this source. Go check out the documentation and see if anything is to your liking. Some of the functions are dependent on other functions that come in the package though so cutting and pasting some functions wotn work unless you cut and paste others. However this is under the bsd license so make sure you read that before you consider copying and pasting.

    I know this code is simple and that was my point. Simple well coded shortcuts and additions to php standard functions.

    Enough talk check out the doc and see if you like it.

    You can get it from
    and documentation is at

    EDIT README removed due to a patch. You will just have to use the documentation at

    I just fixed bugs and added features I should of added before posting this. And now I have time to write a proper summary of what my code is. I originally had one but due to modifications I removed the read me.

    here is the list of functions

    //cleans both arrays and variables by adding \
    //converts arrays to objects objects to arrays windows style dirs to unix style
    //strings to ints and ints to strings
    //displays the first character of a string or first element of an array
    //this will be it will be so useful and make code so much cleaner
    //if the first character is whatever you specify or first element of an array is
    //what you specify then it returns true
    //same as the above but if there is a match the first character or element
    //is deleted
    //removes the first character of any string and first element of an array
    //same as any normal hash but if mhash is installed it will use that
    //otherwise it will use md5 it also has the option of using a key
    //when mhash is installed
    //all of these are the opposite of the above functions with the prefix of first
    //len returns the length of both variables and
    //one function to rule them all)
    //prefixes a string
    //same as print_r but its got added <pre></pre> tags
    //reverses both strings and arrays
    //adds a suffix to a string
    //One_NUM-TwO will be converted to One Num Two
    //returns the type of anything input in string format great for debugging

    I tried to keep things simple these are things i needed for myself but i think they are generic enough to share. I will write a c extension of these when I have the time and lean a bit more c.

    If anyone has anymore ideas for useful dynamic functions and shortcuts just let me know and ill add them. There is more I could of added but I need something to trigger my memory.

    It is simple, and the reason for that is I would be using classes if it was not simple. If you have any comments feel free to leave them.

    Also if you read this post earlier you might of download a copy that was buggy as I realized I had to fix a lot of stuff and add a bit of extra functionality.
    Last edited by Nameless344; 11-14-2006 at 04:18 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts