Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged php



1 ... 39 40 41 42 43 ... 58
from http://www.w3schools.com/php/php_mail.asp
0 807 posted 15 years ago by rwczippy
Function to add custom body class in th Thesis theme for WordPress...Thanks to @girliegeek!
1 942 posted 15 years ago by joelhaus
Hey everyone, I was noticing that there are a lot of ways that people are using to write their own string truncation functions wit the use of other functions like 'substr_replace', but it kinda seemed like a lot of them went a bit too far out to make...
1 763 posted 15 years ago by Admiral
nothing special :)
0 864 posted 15 years ago by adamcoulombe
Escribir archivo de texto en directorio
0 695 posted 15 years ago by pardalsalcap
Variables that are submitted via web forms always need to be cleaned/sanitized before use in any way, to prevent against all kinds of different malicious intent.
0 707 posted 15 years ago by paulgrenwood
this comes from YAPB plugin for WordPress. kudos to the author. (there are some functions that are deprecated in PHP 5.2+ - you'll need to replace eregi with the mb_ version). This should be quite failsafe, regardless if curl is installed or the set...
1 1105 posted 15 years ago by iroybot
To make an image browser, add these lines: $ext = strtolower(substr("$dirArray[$index]", strrpos("$dirArray[$index]", '.') + 1)); //get file extensions if ("$ext" == "jpg") { // if file is a jpg print("<TR><TD>$dirArray[$index]<br/><a href=\...
1 765 posted 15 years ago by beneberle
0 560 posted 15 years ago by zemin
Allows you to convert to any base between 2 and 255, effectively using all the ASCII characters. In order to convert very large numbers with arbitrary precision you’ll need the BCMath lib. Without BCMath the large numbers will not be converted c...
1 828 posted 15 years ago by bucabay
There are plenty of classes out there to paginate through database results, well, here's one to paginate through a static array of items. Written quite a few years ago, recently recovered from a crashed drive.
1 538 posted 15 years ago by evilwalrus
1 1066 posted 15 years ago by AzizLight
A simple function that generates a select drop down. It takes 3 values. The select name ,the mode (true for hours / false for minutes) and the selected option.
1 1119 posted 15 years ago by chchrist
2 784 posted 15 years ago by paulgrenwood
E-mail validation is perhaps the most used validation in web forms, this code will validate email address and also optionally check the MX records of the domain provided in email address to make email validation more robust.
2 929 posted 15 years ago by paulgrenwood
This function will truncate strings only at word breaks which can be used to show a teaser for complete article without breaking words.
0 854 posted 15 years ago by paulgrenwood
Creating thumbnails of the images is required many a times, this code will be useful to know about the logic of thumbnail generation.
0 887 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 873 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 697 posted 15 years ago by paulgrenwood
0 747 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 645 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 1852 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 764 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 794 posted 15 years ago by paulgrenwood
Provide files to the user by forcing them to download.
0 921 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 742 posted 15 years ago by paulgrenwood
1 ... 39 40 41 42 43 ... 58