Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged php



1 ... 37 38 39 40 41 ... 58
I whipped this up after finding that my worst fears were true, pathinfo is slow. Top that with in_array and you've got your self some heavy code. Nothing like regex to speed things up. This little code checks the extension of a path to see if it i...
0 662 posted 14 years ago by Oldarney
Set the default timezone for date/time functions to use if none is set on the server.
0 849 posted 14 years ago by AzizLight
0 534 posted 14 years ago by connordothu
This is using list items to create the calendar so it is very flexible with CSS. Right now it's just displaying dummy data, but you can easily integrate a mysql call into the loop.
3 689 posted 14 years ago by SmpleJohn
Funcion para eliminar los acentos, caracteres que no sean numeros o letras y los espacios blancos. Muy util para renombrar los archivos antes de subirlos al server
0 645 posted 14 years ago by jacinmontava
Here are a few examples that show how the relationship between objects and references
0 725 posted 14 years ago by chrisaiv
0 841 posted 14 years ago by AzizLight
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 659 posted 14 years ago by benjaminpearson
Simple script that returns to us a list with possible TimeZones
0 843 posted 14 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 585 posted 14 years ago by bachya
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 840 posted 14 years ago by chrisaiv
0 768 posted 14 years ago by chrisaiv
0 860 posted 14 years ago by chrisaiv
0 749 posted 14 years ago by iTony
The following are instructions to "re-post" files that have been already been POSTed to your php script. This can help if you want to have a form (with file upload) that POSTs its data to your own script where the text elements can be handled and the...
2 1009 posted 14 years ago by benjaminpearson
This is a simple search function for the [User Groups](http://www.dabbledoo.com/design/docs/User-Groups-Module/) module for ExpressionEngine. It searches groups (names and descriptions) as well as topics and topic replies. It respects group types as...
0 1069 posted 14 years ago by lukemcr
In v1.6, the Thesis Theme has a bug which removes a necessary space in the HTML body tag if you add a filter targeting the thesis_body_classes hook. To get the native WP body_class function to work, use this code:
2 1082 posted 14 years ago by joelhaus
A function i made for running trim on all elements in an array
1 931 posted 14 years ago by Knarf
Inserts a block with the id of 26
1 728 posted 14 years ago by nate63179
A very simple class that quickly gets you interacting with a database, as long as you know sql :P.
1 1306 posted 14 years ago by r3morse
0 579 posted 14 years ago by Actuarybrad
1 758 posted 14 years ago by ReeceMarsland
1 703 posted 14 years ago by ReeceMarsland
1 692 posted 14 years ago by ReeceMarsland
0 633 posted 14 years ago by garretjames
provide file via URL var, and script will grab it & force download. Take a look at code, and add some of your filetypes if required
2 2991 posted 14 years ago by acosonic
A function for returning the ID of the current CMS page
1 865 posted 14 years ago by nate63179
1 ... 37 38 39 40 41 ... 58