Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 134 135 136 137 138 ... 147
Takes a date and returns a string describing how long ago that date was. examples: 3 seconds ago, 5 days ago, 2 years ago, you get the idea :)
17 9638 posted 17 years ago by patcullen
got this as part of an example on the adobe cookbook site
1 1852 posted 17 years ago by mswallace
Worst title ever. Basically, this takes a string like: "Check this out: http://snipplr.com/view/5759/replace-a-url-its-domain-name-and-create-link/" and replaces it with "Check this out: snipplr.com [with a link to the full URL]"
1 2011 posted 17 years ago by jaytee
3 1284 posted 17 years ago by rblalock
Instead of using this function to set the default timezone in your script, you can also use the INI setting date.timezone to set the default timezone. * Does not affect timestamp functions, which are all GMT
0 1472 posted 17 years ago by johnself
1 1214 posted 17 years ago by jesse
This class var creates a belongsTo association between this and another Model
1 1172 posted 17 years ago by jesse
This class var definition configures a Model to have a OneToOne relationship with a Model of another class.
1 1160 posted 17 years ago by jesse
This is the basic edit action suggested by the CakePHP Manual
1 1166 posted 17 years ago by jesse
Many examples that show how to use the header() function of PHP
3 1931 posted 17 years ago by localhorst
2 1550 posted 17 years ago by Tank
0 1123 posted 17 years ago by iTony
1 1143 posted 17 years ago by soxiam
[directory] ├index.php //this snippet ├imageA.jpg ├imageB.gif └imageC.png This snipet displays the thumbnail of the picture file that exists in the same directory. When the thumbnail image is clicked, the original size image is...
6 1830 posted 17 years ago by kyokutyo
Add this arg code plus set first argument as "OG: Group nid(s)"
2 1553 posted 17 years ago by metareason
this is not the ultimate secure way, but it's at least not displaying the email link
3 1504 posted 17 years ago by iTony
It gets images randomly from folder that you've pointed.
4 2694 posted 17 years ago by skywalker
This function can validate and parse UK postcode like SW1A 1AA in to formated array.
2 2047 posted 17 years ago by naz
0 1298 posted 17 years ago by iTony
This will always show the correct date... so it'll say "Copyright 2008 Comapany Name" now, and at exactly midnight on 1st January 2009, it'll say "Copyright 2009 Company Name". Simple!
2 1705 posted 17 years ago by tigercore
taken from wordpress-- it took me a whole to find this on their site
3 1563 posted 17 years ago by melvitax
When processing text for a search engine or analysis tool, code needs to strip out punctuation, formatting, spacing, and control characters to reveal indexable text. In international text there are hundreds of these characters, and some should be rem...
1 1642 posted 17 years ago by localhorst
This snippet shows you how to limit the download rate of a file download.
18 11115 posted 17 years ago by localhorst
I modified some code created by Macromedia Dreamweaver into a flexible function to rebuild the query string. The function is very useful for pagination or passing variables from one page to another.In this version it's possible to add more than one v...
1 1431 posted 17 years ago by gbot
A small function I made to chmod directories and files recursively, with different permissions.
2 2154 posted 17 years ago by Tenzer
1 ... 134 135 136 137 138 ... 147