Welcome To Snipplr


Everyone's Recent Snippets Tagged php



1 ... 4 5 6 7 8 ... 64
Explanation of the method used here in the URL.
0 587 posted 11 years ago by Omnikron13
This function mimics Photoshop overlay blending by accepting two RGB arrays, one which will be overlayed and one which will overlay. Opacity is optional.
0 869 posted 12 years ago by laurikar
La función del SDKphp de facebook 'notifications' envia una notificación por parte de la aplicación al usuario que quieras (que haya aceptado tu aplicación).
0 894 posted 12 years ago by serialk89
Here's the basic principal behind spiders. (ex: <a href="http://giochiflash.123homepage.it">Giochi Flash</a> $html = file_get_contents('http://www.example.com');
6 4920 posted 12 years ago by haydin
JavaScript code to facilitate dynamic re-sizing of an iframe at the same time as the browser window is re-sized, as well as making sure that the frame scales proportionally to its width and height.
1 1070 posted 12 years ago by leodruker
Get the first char of a lastname in php
0 811 posted 12 years ago by dego89
Validating an email address is one of the hardest feats on the web. A valid email can be marketing gold, but an invalid email address is dead weight. Not only does it require a CPU-taxing PHP regular expression ("/^[A-z0-9\._-]+"."@" . "[A-z0-9][A-...
1 1135 posted 12 years ago by mafhh14
This snippet is a lambda function (anonymous function) to create an xml from an array. It uses recursiveness.
1 1166 posted 12 years ago by abrahamsustaita
This example of code shows how to do a simple POST request in PHP to another web server by using a socket connection.
0 1866 posted 12 years ago by apphp-snippets
You need a copy of your model and relations (ObjectStorage properties). In this example there is a model Product with property ProductAddition (1:n relation).
0 907 posted 12 years ago by FazzyX
With increasing of popularity of WordPress script, Gravatars have become a really quite popular. Now you may easy integrate them into your own script as they provide a very easy to use API.
0 717 posted 12 years ago by apphp-snippets
Usually when you're using different CSS files on your site, they might take a quite long to be loaded. Using this PHP code, you can compress them into a single file with no unnecessary white spaces or comments. Why we need to compress multiple CSS fi...
0 866 posted 12 years ago by apphp-snippets
This code allows to remove all duplicate elements from an array using PHP array_unique() function.
0 1218 posted 12 years ago by apphp-snippets
This snippet allows you set a limitation for download rate of the file that visitors download from your site.
1 1658 posted 12 years ago by apphp-snippets
This code shows how to parse XML file in easy way using PHP.
0 1099 posted 12 years ago by apphp-snippets
This code allows to list the contents of any given directory.
1 975 posted 12 years ago by apphp-snippets
This code allows to pass filename in the $file_name variable and function will return file extension only.
0 1016 posted 12 years ago by apphp-snippets
**Example of use:** echo base64DataUri('/var/www/html/background.png'); *or* echo base64DataUri('http://static.php.net/www.php.net/images/php.gif');
0 848 posted 12 years ago by phpdev
This function returns the duration of the given time period in days, hours, minutes and seconds. For example: echo convertSecToStr('654321'); would return "7 days, 13 hours, 45 minutes, 21 seconds"
0 1115 posted 12 years ago by apphp-snippets
You may retrieve all needed file path data using PHP's built-in function pathinfo. You don't need to create your own functions or use regular expressions to get this info. It was already been created for this purpose.
0 1281 posted 12 years ago by apphp-snippets
Sometimes you need to generate passwords for customers automatically when a new account is created. This code allows you choose the desired length and strength for the password and it is very flexible.
0 814 posted 12 years ago by apphp-snippets
Encodes the given data with MIME base64. Base64-encoded data takes about 33% more space than the original data.
0 1209 posted 12 years ago by apphp-snippets
This is a very common PHP question of HOW TO remove last character from string in PHP. Find below some ways how to delete last character from string in PHP.
0 1815 posted 12 years ago by apphp-snippets
This function highlight_string() outputs or returns a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP.
0 768 posted 12 years ago by apphp-snippets
The mail() function allows you to send emails directly from a script. Remember, that most of shared hosting providers require (for security reasons) to use the domain name of your hosting in "FROM" email, e.g. from@yourdomain.com for http://yourdomai...
1 1062 posted 12 years ago by apphp-snippets
If you work with Twitter, you probably use a url shortener such as tinyurl.com or bit.ly to share/post your favorite blog posts or important messages with links on the network. This snippet take your url as a parameter and returns a short url.
0 1114 posted 12 years ago by apphp-snippets
You may use this code to highlight specific words in your displaying search results.
3 1059 posted 12 years ago by apphp-snippets
This code removes all special characters from the given URL and make it SEO friendly.
2 1022 posted 12 years ago by apphp-snippets
Easy PHP script for uploading and unpacking zip files to the server much faster Steps to follow: 1. create folder on the webserver called "zipper" or something else 2. copy the following PHP code into a file called "zipper.php" into this folde...
2 4308 posted 12 years ago by jvandemerwe
Allows to perform PHP redirection (must be placed before any browser output).
0 861 posted 12 years ago by apphp-snippets
1 ... 4 5 6 7 8 ... 64