Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
These two snippets together, the first in the .htaccess file, and the second in your PHP create an elegantly simple solution to arbitrary URLs with php. For a breakdown and example check out the link.
Don't want to follow the link, how about the q...
0
941
posted 12 years ago by FatFolderDesigner
Function to get wordpress post/page slug to be used on for custom class etc
0
970
posted 12 years ago by Farhan
- Mage 1.7* flag storeswitcher
- images/flags/flag_[storeview_name].png
0
641
posted 12 years ago by WGenie
Create variable named PHP variables. Having dynamically named variables can be helpful when dealing with loops and arrays. For example instead of having seven if () statements for handling seven individual days of the week, you could reduce it to one...
0
662
posted 12 years ago by dialeleven
This class is used to store global information for general access throughout the application.
0
763
posted 12 years ago by ryantxr
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0
1102
posted 12 years ago by TimoZachi
This is a callback example that can be used to conditionally display blocks on specific pages. In this example, I load all nodes with a specific field and return false if the value of that field is equal to the user id of the logged in user. The sni...
0
760
posted 12 years ago by chasecrawford
Sometimes it’s helpful to ONLY get numeric characters.
Phone numbers, age — whatever your little PHP heart desires.
0
1850
posted 12 years ago by satie83
replace /app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php
0
849
posted 12 years ago by bogdandev
Adds an excerpt field to pages when editing. Goes in functions.php
1
766
posted 12 years ago by klagraff
Once in a while we need to check whether a string contains substring, some other string or characters or a value. Checking for existence of a string (or substring) inside another string is easier than it might seem. The following article describes ho...
0
891
posted 12 years ago by satie83
This function removes a directory and its contents.
Use with careful, no undo!
1
913
posted 12 years ago by fackz
This function allow you ti have multiple parameters in your query string.
Ex : id=12&name=Doe&id=42&nickname=Monster
0
862
posted 12 years ago by MonsterDev
Takes your table name and key=>value array of values and returns the text for inserting into a MySQL database. Automatically surrounds strings with single quotes.
1
1088
posted 12 years ago by lemcoe9
A simple function for converting a php timestamp (integer) to a user frindly format. Examples: 10 Seconds ago, 4 Days ago. The function converts timestamp to U.F. format only if the timestamp is earlyer than one week. Otherwise it uses $dateFormat ar...
0
1281
posted 12 years ago by TimoZachi
Nice implementation of Blowfish for storing user passwords to prevent decryption when for example the user database is compromised. Origin: Burak Guzel@Nettuts
2
1199
posted 12 years ago by ptodorov
Adds a method to the jQuery Validation plugin (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) to return false if the field equals a specified string
0
1862
posted 12 years ago by StevenW721
Auto language selection based on site languages and user preferences.
0
677
posted 12 years ago by Narayon
Insert this in functions.php to remove WordPress version from being output in the header source code
0
868
posted 12 years ago by klagraff
A regular expression for removing <br> and <br> (case insensitive) between HTML elements if there is no content between the HTML elements. It was written for fixing extra line spaces created in a WordPress visual editor after the content of the visu...
0
820
posted 12 years ago by pumpkinthehead
Useful for adding Custom Post types to navigation this will list all custom post type posts
1
913
posted 12 years ago by i-am-andy
Manually print out a category-navigation in a magento frontend template. within "stristr" you can enter an array of category-ids that should be hidden from display.
0
960
posted 12 years ago by luxmedia
One approach to get all child categories of a magento category.
0
871
posted 12 years ago by luxmedia