Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 107 108 109 110 111 ... 147
Creating thumbnails of the images is required many a times, this code will be useful to know about the logic of thumbnail generation.
0 2035 posted 16 years ago by paulgrenwood
Some times you need to accept some url as input but users seldom add http:// to it, this code will add http:// to the URL if it’s not there.
1 2171 posted 16 years ago by paulgrenwood
With most of the popular web services like Twitter providing their data through APIs, it is always helpful to know how to parse API data which is sent in various formats including JSON, XML etc.
1 1635 posted 16 years ago by paulgrenwood
0 1797 posted 16 years ago by paulgrenwood
This snippet uses isset() instead strlen() to verify a PHP variable (in this example $username) is set and is at least six characters long.
0 1528 posted 16 years ago by paulgrenwood
This code will create a human readable string that will look more close to dictionary words, useful for captchas.
0 5779 posted 16 years ago by paulgrenwood
This function will fetch the real IP address of the user even if he is behind a proxy server.
0 1812 posted 16 years ago by paulgrenwood
If you don’t need human readable string, then use this function instead, which will create a random string you can use for user id’s etc.
1 1828 posted 16 years ago by paulgrenwood
Provide files to the user by forcing them to download.
0 3772 posted 16 years ago by paulgrenwood
With this snippet, you can encode any email address into HTML entities so that spam bots do not find it.
0 1724 posted 16 years ago by paulgrenwood
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
0 1867 posted 16 years ago by paulgrenwood
One drawback: Removal of button leaves a small indent in first line of paragraph, probably an element:style DIV. Don't yet know how to get rid of that.
1 1474 posted 16 years ago by thesislab
Helpful for remembering useful CURLOPT constants. Taken from an example in the php manual comments.
3 2027 posted 16 years ago by DrewDouglass
This a simple wrapper for cgi, write in php, use stdin for post, and query_string env, for get =)
0 1472 posted 16 years ago by renatoelias
I use this to activate basic forms for clients. Just make sure your form input names are named appropriately. Any inputs such as phone or fax that are separated into different inputs should have the same name.
1 2158 posted 16 years ago by dmautz1
I've made some changes
2 1711 posted 16 years ago by fetolio
0 2095 posted 16 years ago by optimiseweb
2 2090 posted 16 years ago by JREAM
agento, an open-source PHP ecommerce solution, has a very comprehensive feature list. However, its built-in CMS doesn’t support hierarchical pages. You can fake it, though. Let’s say you have a page with an SEF (search engine friendly) URL Ide...
0 1868 posted 16 years ago by nico65
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 2485 posted 16 years ago by el-artiste
0 1365 posted 16 years ago by iloveitaly
0 1562 posted 16 years ago by gfazioli
i know these regex stuff is rather slow, but still i like having slim documents. (don't forget to use gzip compression on all text docs)
3 2013 posted 16 years ago by iroybot
This code is not made by me : But it was used for one of my projects. This code scans for all png files in a directory and creates a 100x100 thumbnail and moves it into a specified directory. :.INCLUDES A DATA TEXT CODE WHICH PUTS THE NAMES OF ALL...
2 1677 posted 16 years ago by brandonio21
This code is not made by me : But it was used for one of my projects. This code scans for all jpeg files in a directory and creates a 100x100 thumbnail and moves it into a specified directory. :.INCLUDES A DATA TEXT CODE WHICH PUTS THE NAMES OF A...
3 1712 posted 16 years ago by brandonio21
This code is not made by me : But it was used for one of my projects. This code scans for all gif files in a directory and creates a 100x100 thumbnail and moves it into a specified directory. :.INCLUDES A DATA TEXT CODE WHICH PUTS THE NAMES OF AL...
2 1823 posted 16 years ago by brandonio21
1 ... 107 108 109 110 111 ... 147