Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 17 18 19 20 21 ... 147
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 742 posted 11 years ago by FatFolderDesigner
Basic template for Joomla 2.5 with 3 columns
1 734 posted 11 years ago by gradamedia
Function to get wordpress post/page slug to be used on for custom class etc
0 765 posted 11 years ago by Farhan
Show html on homepage and different html on other pages
0 721 posted 11 years ago by morktron
Created by Quirol to avoid TOTAL errors
0 549 posted 11 years ago by mrtonix
- Mage 1.7* flag storeswitcher - images/flags/flag_[storeview_name].png
0 531 posted 11 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 507 posted 11 years ago by dialeleven
This class is used to store global information for general access throughout the application.
0 587 posted 11 years ago by ryantxr
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 878 posted 11 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 611 posted 11 years ago by chasecrawford
Sometimes it’s helpful to ONLY get numeric characters. Phone numbers, age — whatever your little PHP heart desires.
0 1584 posted 11 years ago by satie83
replace /app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php
0 677 posted 11 years ago by bogdandev
Adds an excerpt field to pages when editing. Goes in functions.php
1 622 posted 11 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 711 posted 11 years ago by satie83
This function removes a directory and its contents. Use with careful, no undo!
1 734 posted 11 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 691 posted 11 years ago by MonsterDev
Search recursively some value in array with the key name
0 769 posted 11 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 875 posted 11 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 1055 posted 11 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 974 posted 11 years ago by ptodorov
Gets the constants from a class using reflection.
0 872 posted 11 years ago by ryantxr
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 1599 posted 11 years ago by StevenW721
list all files in directory and subdirectory
1 794 posted 11 years ago by ne7son
Auto language selection based on site languages and user preferences.
0 523 posted 11 years ago by Narayon
Insert this in functions.php to remove WordPress version from being output in the header source code
0 663 posted 11 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 601 posted 11 years ago by pumpkinthehead
Useful for adding Custom Post types to navigation this will list all custom post type posts
1 712 posted 11 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 761 posted 11 years ago by luxmedia
One approach to get all child categories of a magento category.
0 698 posted 11 years ago by luxmedia
1 ... 17 18 19 20 21 ... 147