Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 123 124 125 126 127 ... 147
1 1437 posted 17 years ago by fackz
An example of how to write your own navigation with dynamic "active" classes.
3 2147 posted 17 years ago by kristarella
this will give you a lovely RSS. Im sure you will need to edit the database stuff and row names
5 2248 posted 17 years ago by antpaw
0 1226 posted 17 years ago by gerhardsletten
A PHP function that correctly validates all parts of a given email address, according to RFCs 5322, 5321, 1123, 2396, 3696, 4291, 4343, 2821 & 2822. I’ve released it under a license that allows you to use it royalty-free in commercial or non-commer...
4 2630 posted 17 years ago by dominicsayers
Is.Gd is a URL-shortening service much like TinyURL. Using PHP’s cURL library, you can create shortened URLs on the fly with ease. “is.gd” is much shorter than “tinyurl.com” so if you need the URL to be as short as possible, use this method...
0 1710 posted 17 years ago by nerdsane
If reading email from a POP box with PHP, you can use this to strip out signatures (ones that are delimited with the proper '--' notation). It will only strip the last signature of an email, in case someone enters a '--' intentionally elsewhere.
0 1735 posted 17 years ago by DaveChild
1 1743 posted 17 years ago by gfazioli
I use this snippet to force a number to 2 decimal places. Eg, For prices, PHP rounds the number 22.20 to 22.2. This code forces a zero on the end if there isn't 2 decimal places already.
1 1753 posted 17 years ago by xtheonex
Function to return the current page name, without the location of it... Eg, for the URL http://localhost/www/someproject/index.php, this would return index.php
1 1407 posted 17 years ago by xtheonex
A quick, usefull function which i use to convert a date/time string pulled from MySQL, into a readable format.
1 1662 posted 17 years ago by xtheonex
Use with (in custom.css) .sidebar_box {margin-bottom:2em; text-align:center;} You may have to adjust the width for your sidebars.
2 1975 posted 17 years ago by kristarella
The function content should work in any theme, it's just wrapped in a function wrapper for insertion into the Thesis theme.
2 1833 posted 17 years ago by kristarella
This CSS is nice to use with this function: .custom .avatar {float:left; border:3px solid #ddd; margin-right:1em;}
2 1638 posted 17 years ago by kristarella
You will probably have to hide the medium sized image.
2 1769 posted 17 years ago by kristarella
3 1620 posted 17 years ago by kristarella
This shows how to add content (in this case a linked image) to the end of a post using WordPress custom fields and the Thesis theme.
6 2129 posted 17 years ago by kristarella
So. You have some minutes and want a "human readable" version? Sure thing baby!
2 8969 posted 17 years ago by optimal
You only use the filename as $value for get_mimetype().
1 1641 posted 17 years ago by fackz
To be placed inside a loop or a query
1 1541 posted 17 years ago by davebowker
0 1883 posted 17 years ago by Wardy
[quote]$_SERVER['HTTP_REFERRER']'s problem is that can be spoofed, but it's better than nothing if you really want that.[/quote]
1 2001 posted 17 years ago by luizlopes
Thanks to LenK on the WP forums.
3 1543 posted 17 years ago by kristarella
1 ... 123 124 125 126 127 ... 147