Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 118 119 120 121 122 ... 147
This snippet returns a link to twitter for the user to tweet the current page. URL is TinyURLed automatically (and tinyurls are cached indefinitely in assets/cache/tweetthis.txt). Simply paste code into a new snippet called "TweetThis". Call it li...
3 815 posted 15 years ago by DaveChild
Grab 5 latest Wordpress posts and display them on a non-Wordpress PHP page.
1 705 posted 15 years ago by kwilson
Magic quotes for incoming GET/POST/Cookie data. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.
0 780 posted 15 years ago by lzyy
Use [short] in a post to insert the text from the function.
2 772 posted 15 years ago by kristarella
Place the following function in your theme's template.php
5 959 posted 15 years ago by zachharkey
fond this, and want to try it.
0 821 posted 15 years ago by stavelin
Put this before the loop in archive.php to have posts in the archive for category '26' sorted by custom field 'date'. Assign sortable values like '090501' or '2009-05-01' to those fields when editing posts and your Upcoming Events will be sorted by...
8 1895 posted 15 years ago by hussong
1 840 posted 15 years ago by michaelfox
1 691 posted 15 years ago by fackz
1 689 posted 15 years ago by michaelfox
A fallback for php's json_encode functionality. What do you think?
1 690 posted 15 years ago by kirie
0 607 posted 15 years ago by kokikr
0 835 posted 15 years ago by albertomori
Script to clear all Drupal caches from a url (it's bookmarkable)
1 667 posted 15 years ago by terrencewood
2 702 posted 15 years ago by level09
This function will convert any long url into a Diggbar url
2 786 posted 15 years ago by jdstraughan
1 647 posted 15 years ago by troynt
Skor PHP Template class can assign individual variable values or arrays with several variable values. A separate sub-class extends the base class to support delimited template section replacements.
0 695 posted 15 years ago by Agundur
Wandelt eine Datetime in eine deutsches Datum um
0 641 posted 15 years ago by bpa
You can get hostname from script environment - getenv("HTTP_HOST") (?!'.$host.') matches URLs always except local links
0 783 posted 15 years ago by kossmoss
This example is adding a feature box after the first post. You can apply it to any of the hooks inside the loop.
2 743 posted 15 years ago by kristarella
In phpMyAdmin you can define strftime formats for your dumped database sql files. Here you are with two formats, one for sigle table export, one for multi-table export.
0 850 posted 15 years ago by dawjdh
Affects <A> tags for links starting with $link Example: LinkReplacer ($text, 'http://www.snipplr.com') affects to <a href="http://www.snipplr.com">Snipplr</a> and <a href="http://www.snipplr.com/blog">Snipplr Blog</a>
0 875 posted 15 years ago by kossmoss
1 ... 118 119 120 121 122 ... 147