Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Use by sending a unix timestamp to countTime(timestamp). It will return something like 40 seconds , 2 weeks, 1 hour. Then just format to your needs like we do in our app: Someone was here 10 minutes ago.
0
634
posted 13 years ago by GeorgeL
Ported to PHP from here:
http://snipplr.com/view/48067/ (original: http://paulirish.com/2009/random-hex-color-code-snippets/)
2
840
posted 13 years ago by ozke
converts array (which is reference) in format
<code>
array(0 => array('id' => 1, 'name' => 'orange'), 1 => array('id' => 3, 'name' => 'banana'));
</code>
to
<code>
array(1 => array('id' => 1, 'name' => 'orange'), 3 => array('id' => 3, 'n...
0
566
posted 13 years ago by slav123
Registro de usuario en PHP con validación y activación por mail
0
1196
posted 13 years ago by danideu
Registro de usuarios en PHP con validación y activación por mail
0
1279
posted 13 years ago by danideu
This simply takes an array and coverts it to variables. E.g. If you had an array, $array = array("key" => "value"), after running this script, $key would be "value".
0
597
posted 13 years ago by mloberg
PHP
Handy PHP thing I can\'t come up with a title for; display different data depending on where user comes from, sort of
If user enters city.php from footer.php, page will return certain string. If user enters independently, solution lets user see predefined string (in this case, 'your city').
0
1069
posted 13 years ago by stephcode
found this somewhere online...not the author, but works like a charm
0
673
posted 13 years ago by sadus
This class can log messages to a file. If the log file becomes too large (over 1MB), the class will archive it and will create new. If there are archives older than one month, they will be deleted automatically.
In the future versions I will add th...
0
786
posted 13 years ago by stz184
IE will redirect the entire page, and disable any ajax calls within an iframe application. This fixes those issues.
0
557
posted 13 years ago by theriddlebrothers
Encode mailto links and (plain) email addresses on your site and hide them from spambots. Easy to use, plugin works directly when activated.
Features
* Protect all emails and mailto links
* Check posts, widgets, comments and RSS feeds
* Encode...
0
884
posted 13 years ago by freelancephp
View class that contains features like:
- get vars inside the view with:
1) $var1
2) $this->var1
3) or $this->get( 'var1', 'defaultValue' )
- factory method for direct chaining:
Lim_View::factory( 'test.php' )->set( 'var1', 'value1' )->...
0
625
posted 13 years ago by freelancephp