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 1278 posted 15 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 1281 posted 15 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 993 posted 15 years ago by paulgrenwood
0 1064 posted 15 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 941 posted 15 years ago by paulgrenwood
This code will create a human readable string that will look more close to dictionary words, useful for captchas.
0 3136 posted 15 years ago by paulgrenwood
This function will fetch the real IP address of the user even if he is behind a proxy server.
0 1119 posted 15 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 1128 posted 15 years ago by paulgrenwood
Provide files to the user by forcing them to download.
0 1273 posted 15 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 1087 posted 15 years ago by paulgrenwood
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
0 1154 posted 15 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 913 posted 15 years ago by thesislab
Helpful for remembering useful CURLOPT constants. Taken from an example in the php manual comments.
3 1289 posted 15 years ago by DrewDouglass
This a simple wrapper for cgi, write in php, use stdin for post, and query_string env, for get =)
0 920 posted 15 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 1313 posted 15 years ago by dmautz1
I've made some changes
2 1069 posted 15 years ago by fetolio
0 1395 posted 15 years ago by optimiseweb
2 1250 posted 15 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 1215 posted 15 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 1759 posted 15 years ago by el-artiste
0 845 posted 15 years ago by iloveitaly
0 981 posted 15 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 1215 posted 15 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 1094 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 1086 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 1143 posted 16 years ago by brandonio21
1 ... 107 108 109 110 111 ... 147