Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Proper enumerations in PHP are hard to come by. This uses a class as a pseudo enumeration. Sometimes you'll want to lookup the string name side of the enum when you have the value (ie, you have "1" and you want the string "Flood").
0
1094
posted 15 years ago by benjaminpearson
Simple script that returns to us a list with possible TimeZones
0
1317
posted 15 years ago by AzizLight
This function takes a start time, an end time, and an interval ("step size"). It returns an array of times separated by that interval between the start time and end time (similar to what Google Calendar does). The keys of the array are the number o...
2
986
posted 15 years ago by bachya
The code to find all objects from a model and use them as select options.
1
1438
posted 15 years ago by smoothdzion
Dates and Time are always important to understand in any language. PHP has some rockin' functions but here are a few that I use the most.
0
1252
posted 15 years ago by chrisaiv
For separating a list of categories with a comma that are linked. There may be a better way. Leave a comment if you have a better way. This was the first way I found that worked.
This code increments the count 1 at a time. It applies the incre...
1
1101
posted 15 years ago by smoothdzion
Used to create checkboxes to select multiple categories for a post or any other type of applicable situation.
1
1055
posted 15 years ago by smoothdzion
Gets the outerHTML of a DOMElement. For a more optimal version check the URL.
0
1346
posted 15 years ago by Znupi
This is a snippet that will animate in a circle in a clockwise fashion based on the parameters the function is passed. It can be used to create a circular or clock wipe when used as a mask.
2
1767
posted 15 years ago by sottenad
Just updated for WP 3 (added wp_postmeta table for menus)! Test out the new installation thoroughly but everything should be fine, and your CMS should be running live on the new server!
0
1167
posted 15 years ago by beneberle
This program show two columns of temperature. In left - t of celsius, in right - t. of fahr.
0
1024
posted 15 years ago by iLLUMIN