Welcome To Snipplr
Everyone's Recent Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Many scripts rely on `$_SERVER[SCRIPT_URL]` which is sometimes missing. This function detects it from other server variables and fixes the missing field.
1
1660
posted 15 years ago by drwitt
Orders a multi-dimensional array by one of it's fields.
There is also the option to treat this like an SQL-style 'order by' query with the $field value passed in (ie. 'user_id desc') to do reverse ordering.
0
658
posted 15 years ago by browncardigan
here's a script, mod_files.sh, in ext/session for creating directory
tree with depth X for sessions. As it stands, it's pretty poorly
documented and very basic. I * got exceptionally bored and rewrote most
of it, the patch is attached. It runs...
0
1160
posted 15 years ago by nkm
This PHP class lets you clean and repair html code. WHAT IT DOES: delete closed tags without their opening tag, fix open tag without close, closing them automatically, check bad nesting and fix them, fix bad quotes in attributes, merge different styl...
2
2421
posted 15 years ago by ginoplusio
PHP encrypts your E-mail address and generates the javascript that decrypts it. Most bots and spiders can't execute javascript and that is what makes this work.
3
1171
posted 15 years ago by fackz
A utility function to preserve an array in a session. Adding the newest element to the beginning of the array and popping out the last one. Useful for displaying for instance; your last searches option in your website.
1
1043
posted 15 years ago by Heroftime
A little function I add to the base Page_Controller class that allows you to define what actions are explicitly SSL. It will put users in SSL when they access it and take them out of it when they navigate somewhere else. It is available in any cont...
0
541
posted 15 years ago by dalethedeveloper
Con esta funcion podemos recortar una cadena de texto indicandole cuantos caracteres queremos que tenga y ademas no cortara la ultima palabra.
0
718
posted 15 years ago by jacinmontava
Simple function that sorts a bi-dimensional array by one of it keys.
1
1118
posted 15 years ago by AlejoLuc
Uses JSON Lite SWC/Class from http://thanksmister.com/?p=40
0
1035
posted 15 years ago by allnatural
Every MySQL class for PHP I've seen so far has been an epic disappointment. This will not lead you to feel the same way. Enjoy!
0
646
posted 15 years ago by jrgp
Used to copy the user avatar from Facebook to your community in this [Facebook Connect Tutorial](http://www.barattalo.it/facebook-connect-tutorial/ "Tutorial").
1
1004
posted 15 years ago by ginoplusio
PHP provides many date manipulation devices and an entire suite of date functionality with the datetime class. However, this does not address date validation, that is, what format a date is received in. The PHP strtotime() function will accept many f...
1
1213
posted 15 years ago by kanampo