Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Takes a .sql file and runs trough that, each line as an update_sql.
Very usefull to track and migrate your blocks/views/cck etc changes.
0
828
posted 15 years ago by berkes
This makes template code that applies to children of a particular page much more readable, especially if you can use a page path instead of an ID: `if ( is_child_of( 'topic/subtopic' ) ) :`.
1
869
posted 15 years ago by cyberhobo
Function to add custom body class in th Thesis theme for WordPress...Thanks to @girliegeek!
1
944
posted 15 years ago by joelhaus
Hey everyone, I was noticing that there are a lot of ways that people are using to write their own string truncation functions wit the use of other functions like 'substr_replace', but it kinda seemed like a lot of them went a bit too far out to make...
1
763
posted 15 years ago by Admiral
This code allows you to track each step of Magento's One Page Checkout in Google Analytics. I installed it at the bottom of my `checkout/onepage.phtml` template file. Once installed, you can set up a funnel for the following:
* `/checkout/onepage/...
0
783
posted 15 years ago by jdbartlett
This snippet is usable for telephone number normalization. It supports re-mapping of misused alphabetical characters (e.g. i for 1) and some other clean up stuff... Take a look.
Update, 2009-10-02: added function to create a corresponding MySQL RE...
1
923
posted 15 years ago by dreadwarrior
Variables that are submitted via web forms always need to be cleaned/sanitized before use in any way, to prevent against all kinds of different malicious intent.
0
707
posted 15 years ago by paulgrenwood
this comes from YAPB plugin for WordPress. kudos to the author.
(there are some functions that are deprecated in PHP 5.2+ - you'll need to replace eregi with the mb_ version). This should be quite failsafe, regardless if curl is installed or the set...
1
1105
posted 15 years ago by iroybot