Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 123 124 125 126 127 ... 147
1 936 posted 16 years ago by fackz
An example of how to write your own navigation with dynamic "active" classes.
3 1266 posted 16 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 1323 posted 16 years ago by antpaw
0 791 posted 16 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 1582 posted 16 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 1029 posted 16 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 1088 posted 16 years ago by DaveChild
1 1137 posted 16 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 1149 posted 16 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 917 posted 16 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 1121 posted 16 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 1168 posted 16 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 1177 posted 16 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 1090 posted 16 years ago by kristarella
You will probably have to hide the medium sized image.
2 1085 posted 16 years ago by kristarella
3 1041 posted 16 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 1191 posted 16 years ago by kristarella
So. You have some minutes and want a "human readable" version? Sure thing baby!
2 6887 posted 16 years ago by optimal
You only use the filename as $value for get_mimetype().
1 1125 posted 16 years ago by fackz
To be placed inside a loop or a query
1 981 posted 16 years ago by davebowker
0 1188 posted 16 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 1292 posted 16 years ago by luizlopes
Thanks to LenK on the WP forums.
3 1037 posted 16 years ago by kristarella
1 ... 123 124 125 126 127 ... 147