Welcome To Snipplr


Everyone's Recent Snippets Tagged php



1 ... 46 47 48 49 50 ... 64
More info found in the link above, basically, you can replace the $config['base_url'] to the snippet below and you no longer need to set the base url. Useful for making your application more portable.
7 1409 posted 16 years ago by DrewDouglass
Thanks to James Padolsey for sharing this script with everyone on his blog, link above.
0 928 posted 16 years ago by DrewDouglass
All credit for this code goes to the all mighty Fou-Lou of codingforums.com (link given).
0 2329 posted 16 years ago by DrewDouglass
2 1187 posted 16 years ago by blackf0rk
0 899 posted 16 years ago by endorfin
2 1093 posted 16 years ago by justinseiter
Need a function to clean your _POST array before inserting into a database? Just pass $_POST to this function.
1 2087 posted 16 years ago by the_dev
It's easy to print out an array that is readable and with only one line of code. This can easily be turned into a nifty function.
1 946 posted 16 years ago by the_dev
Here is the correct way to turn your mysql results into an array. Forget the other nonsense of useless code. Why type out this long code: "for($i = 0; $array[$i] = mysqli_fetch_assoc($result); $i++) ;" when you can accomplish the same thing with m...
1 1395 posted 16 years ago by the_dev
0 717 posted 16 years ago by iloveitaly
0 1267 posted 16 years ago by welly
4 1468 posted 16 years ago by welly
2 1392 posted 16 years ago by Thresh
There's another snippet on here that always comes up on google for finding the relative path to the root, but it doesn't work very well. This version will work from the root, from any subdirectory, and with malformed path names such as www.example.co...
3 1792 posted 16 years ago by blackhole12
This little bit of code is a calculator of the "golden mean" of a given length of time. For example: given a length of 1 minute and 0 seconds, the answer given will be 0:00:37. See U2's "With or Without You", the Greek Parthenon, the human body, etc....
1 2150 posted 16 years ago by rossuber
All you need to do when writing the post, is enter a custom field with the key "expiration" and set the value in the format: "2010/01/01 18:20:00" - this would expire the post at 6.20pm on the 1st January 2010.
1 1158 posted 16 years ago by gjindancer
This is a slightly hard core email check. I work for clients that want real email addresses. They pay quite a bit of money so yes, I am going to give what they want...
3 1263 posted 16 years ago by brownrl
Face it! Whenever you make a website/app you always need to make XLS export for the simple people. I mean heaven to betsy if they have to take a csv file, or use phpMyAdmin. So Here are 3 little functions and a sample skeleton that I use fro...
6 1789 posted 16 years ago by brownrl
Some PHP code that can be used to get formatted HTML containing N number of tweets for a given twitter user.
5 1683 posted 16 years ago by gripnrip
this script splits the csv file two times (1. on "new line", 2. on ";") and returns a two dem array in the last for loop.
2 1169 posted 16 years ago by antpaw
This is a good way to validate form input from PHP, in essence this could be a blue print for your forms.
5 1361 posted 16 years ago by brownrl
drop the prefix fields and sort , profile by type
0 1356 posted 16 years ago by rowntreerob
1 1038 posted 16 years ago by vali29
0 848 posted 16 years ago by wokon
Construct DateTime object with unix timestamp
0 1101 posted 16 years ago by iloveitaly
0 802 posted 16 years ago by stancell
Taken from Doug Sparling's Blog
0 771 posted 16 years ago by roflman79
1 ... 46 47 48 49 50 ... 64