Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged php



1 ... 46 47 48 49 50 ... 58
Simply create a new index.php and place this code within.
1 778 posted 15 years ago by chrisaiv
18 5956 posted 15 years ago by sidisinsane
0 933 posted 15 years ago by eden159
0 896 posted 15 years ago by troynt
0 629 posted 15 years ago by troynt
In my app, we have to auto-generate usernames for our users, here is the code I did.
2 1163 posted 15 years ago by luctus
To use href.in API to generate a short URL. using php curl
1 761 posted 15 years ago by nerdsane
Figure out if the string possesses only hexadecimal characters in the string. If not, fail. Remember, white spaces are not hexadecimal, so make sure you trim() your strings before you send it in or explode your string.
0 1220 posted 15 years ago by duniyadnd
your database needs id, bezeichner and parent fields
1 738 posted 15 years ago by antpaw
This is a basic shell for PayPal IPN. It is by no means a complete solution, but it should provide a good starting point for anyone that wants to work out IPN. Or it can be used as is to do basic IPN.
2 799 posted 15 years ago by xtheonex
1 914 posted 15 years ago by iroybot
One other thing to note, is that the php generated css file can make use of query parameters, for instance: <link rel="stylesheet" href="base.css.php?type=alternate" type="text/css" > in your PHP file you can use the variable: if ($_GE...
2 1163 posted 15 years ago by dbug13
1 693 posted 15 years ago by fackz
An example of how to write your own navigation with dynamic "active" classes.
3 1017 posted 15 years ago by kristarella
2 800 posted 15 years ago by dbug13
this will give you a lovely RSS. Im sure you will need to edit the database stuff and row names
5 1110 posted 15 years ago by antpaw
Is.Gd is a URL-shortening service much like TinyURL. Using PHP’s cURL library, you can create shortened URLs on the fly with ease. “is.gd” is much shorter than “tinyurl.com” so if you need the URL to be as short as possible, use this method...
0 776 posted 15 years ago by nerdsane
If reading email from a POP box with PHP, you can use this to strip out signatures (ones that are delimited with the proper '--' notation). It will only strip the last signature of an email, in case someone enters a '--' intentionally elsewhere.
0 822 posted 15 years ago by DaveChild
1 917 posted 15 years ago by gfazioli
I use this snippet to force a number to 2 decimal places. Eg, For prices, PHP rounds the number 22.20 to 22.2. This code forces a zero on the end if there isn't 2 decimal places already.
1 870 posted 15 years ago by xtheonex
Function to return the current page name, without the location of it... Eg, for the URL http://localhost/www/someproject/index.php, this would return index.php
1 721 posted 15 years ago by xtheonex
A quick, usefull function which i use to convert a date/time string pulled from MySQL, into a readable format.
1 878 posted 15 years ago by xtheonex
To be placed inside a loop or a query
1 762 posted 15 years ago by davebowker
0 962 posted 15 years ago by Wardy
1 901 posted 15 years ago by ginoplusio
Helpfull function to remove recursively specific folders.
3 824 posted 15 years ago by eden159
1 ... 46 47 48 49 50 ... 58