Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
**Example of use:**
<a href="http://www.php.net/manual/en/index.php"><img src="<?php echo get_favicon('http://www.php.net/manual/en/index.php') ?>" alt="Favicon" title="See PHP documentation" width="16" height="16" /></a>
0
1524
posted 11 years ago by phpdev
Helps to find out browser version and type your website visitor is using.
0
914
posted 11 years ago by apphp-snippets
This code allows to get the IP address from which the user is viewing the current page.
0
1123
posted 11 years ago by apphp-snippets
This is a hook_block_info and hook_block_view template that will allow you to quickly create blocks in a Drupal module. When you use this all you have to do is create a directory "blocks" in the module and then create block.block_name.php in the dire...
0
822
posted 11 years ago by brownrl
Script per copiar els fitxers canviats en una revisió git al servidor remot via sftp, using PHP Secure Communications Library (phpseclib): http://sourceforge.net/projects/phpseclib/.
Útil per usar amb 1and1.
0
975
posted 11 years ago by marcniko
The following codes populate the country list into dropdown box based on browser's languages. The country information is getting from geolocation.com
0
968
posted 11 years ago by Hexahow
Checks if two given arrays equal each other as php doesn't have a built in function for this.
0
830
posted 11 years ago by MaxHudson
If you are using the [TimThumb](http://code.google.com/p/timthumb/ "TimThumb on Google Code") script with a URL the contains tildes (~) and images are breaking, here is the fix...
I did not create this snippet but found it extremely useful so I th...
0
1008
posted 11 years ago by tacudtap
For some reason tidy inserts new lines before/after <![CDATA[ content in XML files. Since I like the benefits of a reformatted, readable XML...
... i run tidy first, then remove the spaces before/after the CDATA block:
0
1038
posted 11 years ago by iroybot
To keep up on important incidents on your site without having to dig through server logs the alternative can be custom logs.
0
857
posted 11 years ago by COBOLdinosaur
**Example of use:**
$bIsConnected = check_internet_connection();
$sText = ($bIsConnected) ? 'You are connected to the Internet.' : 'You are not connected to the Internet.';
echo $sText;
0
1889
posted 11 years ago by phpdev
simple image rotation script; save as rotate.php in folder with images, call <img> to display
0
1052
posted 11 years ago by goddess
To set cookie use "cookie('name of your cookie','cookie data','expire date ')" it will set your cookie in the user browser .
To get the saved cookie use "cookie('name of your cookie')" it will give you the value of the cookie which you saved in the...
0
824
posted 11 years ago by kameshsoft
This useful function will convert a time in seconds to a time in years, months, weeks, days, and so on.
0
1670
posted 11 years ago by goo
Here is a set of functions that can be very useful: Give this script the url of a webpage, and it will save all images from this page on your server.
1
1659
posted 11 years ago by goo
Izvorni kod za web aplikaciju u kojoj smo implementirali validaciju jednokratne zaporke koju generira uređaj YubiKey.
0
522
posted 11 years ago by DSTG_Kwan
Thanks Dan Gayle.
http://www.dangayle.com/import-feeds-wordpress-fetch-feed/
2
1175
posted 11 years ago by adambundy
Script File launched every 3 minutes to check WebSite status.
It uses AWSSDKforPHP library http://docs.amazonwebservices.com/AWSSdkDocsPHP/latest/DeveloperGuide/php-dg-setup.html
0
833
posted 11 years ago by cduquev
Return a pure 10-digit phone number if the number given is 10 digits or 11 digits.
0
1428
posted 11 years ago by chrisvogt
[register_nav_menus](http://codex.wordpress.org/Function_Reference/register_nav_menus,"register_nav_menus")
[wp_nav_menu](http://codex.wordpress.org/Function_Reference/wp_nav_menu,"wp_nav_menu")
[in_category](http://codex.wordpress.org/Function_Ref...
0
863
posted 11 years ago by hell0world