Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged file



Create log.txt in scripts directory and set permissions to 0666 before use.
0 1389 posted 16 years ago by Nek
Easy file create/write script
0 1071 posted 16 years ago by jspicher
This snippet is just an upgrade to the "http://snipplr.com/view/7396/php-file-extension-case-changer/" code. This particular code works on image files... although you can just change this line [if (preg_match("/(jpg|gif|png|bmp)/",$ext)) ] to target...
0 2023 posted 16 years ago by el-artiste
0 1497 posted 16 years ago by iloveitaly
This piece of code will store each line of a txt file into a mysql database
2 2124 posted 16 years ago by fackz
This function converts file size in bytes to the larger units. You can add bigger values like exa-, zetta-, yotta- bytes.
0 1303 posted 16 years ago by kirik
By requinix
0 1124 posted 16 years ago by smoover
A few days ago i was looking for a script witch one will help me to unzip a file using PHP . There is 2 different ways to do it.One just execute a commend to unzip the file in the shell using PHP and another one is using library functions
2 1565 posted 16 years ago by fackz
2 1722 posted 16 years ago by cshaiku
3 2695 posted 16 years ago by fackz
4 1689 posted 16 years ago by level09
0 1115 posted 16 years ago by scalhoun2005
These 4 lines of code can be used to extract and return all links from any page using regex patterns. If links are found, an array is returned, else boolean false is returned.
4 2292 posted 16 years ago by gdvickery
This method is a bit faster and more reliable then using the "explode" method. Works with PHP 4.0.3 and up.
4 1888 posted 16 years ago by gdvickery
1 1274 posted 16 years ago by jonniespratley
You only use the filename as $value for get_mimetype().
1 1443 posted 16 years ago by fackz
1 1605 posted 16 years ago by ginoplusio
1. Edit the html form 'action' to point to your PHP page that handles the upload. 2. Create the php page with the code below 3. Define Paths in PHP lines: 3 , 4 of php file 4. Create matching folder to paths in #3 on server. 5. chmod that folder...
4 1855 posted 17 years ago by jadedbat
3 1717 posted 17 years ago by benphelps
3 1890 posted 17 years ago by benphelps
3 1787 posted 17 years ago by gbot
Expands a MySQL / Gzipped file and executes it's queries.
0 1521 posted 17 years ago by mattkenefick
include file protection...
2 1409 posted 17 years ago by skywalker
4 1676 posted 17 years ago by iTony
got this as part of an example on the adobe cookbook site
1 1818 posted 17 years ago by mswallace
This snippet shows you how to limit the download rate of a file download.
18 11040 posted 17 years ago by localhorst
2 1422 posted 17 years ago by gbot
0 1677 posted 17 years ago by coggla
The original code was meant to be used with register_globals=on. If you cannot or don't want to turn that on, then I have modified the code to work with register_globals=off.
4 1769 posted 18 years ago by Jaymoon