Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Use this function if you need to get the same day in the next month (or how many you need).
Using defaults functions of php you got this:
echo date('Y-m-d', strtotime( " + 1 month " , strtotime('2010-01-31'))); (Output: '2010-03-03')
and if yo...
0
454
posted 13 years ago by vitorbari
Summary
=======
A useful function for masking arrays. Very useful if you have a function or method that takes arguments in an array, and you would like to force that array to have a specific structure.
Its also great for setting defaults due to...
0
924
posted 13 years ago by RobertWHurst
Very useful line of code that I'm using very often to prevent old and cached CSS file being served to visitors. You just need to use timestamp of the file.
0
766
posted 13 years ago by vagrantradio
Originally from:
http://wordpress.mfields.org/2010/selective-page-hierarchy-for-wp_list_pages/
0
585
posted 13 years ago by lawlesscreation
To enable error reporting for *ALL* error messages including every error level (including E_STRICT, E_NOTICE etc.), simply use:
1
373
posted 13 years ago by Hepamin
Very usefull translation adapter for simple interfaces where creating translation files is just a bit to much.
1
481
posted 13 years ago by RonXS
Use this to fix Pagination Problem on query posts page. This will fix the problem where clicking on the next page keeps showing same posts
1
571
posted 13 years ago by Farhan
Takes the ID of a page, then displays a list of child pages with thumbnails and page titles. The thumbnail is generated from the 'featured image' of the particular child page.
2
770
posted 13 years ago by martinlucas
This snippet saves in the $return array all the names of the fields that a content type has added with CCK, has to be installed the cck module.
0
1193
posted 13 years ago by JohnnyGamba
Script used to access the Envato API, and get extra details using Curl.
This script will only work on PHP5 on a Linux hosting account (with safe mode / openbasedir disabled). Will need slight adjustment if trying to run it otherwise.
You are w...
1
931
posted 13 years ago by dtbaker
CSS:
<pre><code>div.pagination {
padding: 3px;
margin: 3px;
}
div.pagination a {
padding: 2px 5px 2px 5px;
margin: 2px;
border: 1px solid #AAAADD;
text-decoration: none; /* no underline */
color: #000099;
}
div.pagination a:...
1
512
posted 13 years ago by Alexxandar
Prints an array (recursive) as PHP code (can be pasted into a php file and it will work).
Note: This function can process arrays with integers/strings/sub-arrays. It is impossible to process resources (they have a state), and while it is possible...
1
688
posted 13 years ago by BrunoDeBarros