Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
A function to get a files size via curl. Accepts $_path, $_unit, $_float, $_username & $_password; In the listed order.
1
1296
posted 12 years ago by o0110o
Takes a # of seconds and converts it to human readable format.
If happened within seconds-years.
0
993
posted 12 years ago by mburica
I will show you how to crate an app for facebook to handle the facebook connect process on your web site.
Then I will show you the php code to perform the login on facebook and retrieve the informations you need for your site.
The last suggestion w...
0
1025
posted 12 years ago by ginoplusio
When you add facebook like button to your site, probably, you also want to save the number of likes of your pages to your database.These data are very useful and very important because they tell you which of your articles are better than others. More...
0
1364
posted 12 years ago by ginoplusio
Use: echo format_size(filesize("fichier"));
Example result: 13,37 Ko
0
893
posted 12 years ago by zhyar
This is a route that ables the website to show the user's profile to the world.
0
605
posted 12 years ago by rafaelfragosom
Just an example showing how to minimise the mixture of HTML and PHP in a view.
0
734
posted 12 years ago by JonnySnip3r
easy way of catching and displaying errors and return values from a exec() command back in PHP.
0
899
posted 12 years ago by iroybot
easy way of catching and displaying errors and return values from a exec() command back in PHP.
0
986
posted 12 years ago by iroybot
Reduces the string size according to the parameter that has been send and put '...' at the end of the new string
0
586
posted 12 years ago by Gianino
I use this primarily for debugging purposes. This simply takes an array and creates an expandable item that prints the array out in a \<pre\> wrapping, making it easy to read. Very basic snippet.
0
1011
posted 12 years ago by ringo380
Allows you to connect to different datasources. Very common to use something like this for development,staging and production deployments.
0
798
posted 12 years ago by evinweissenberg
These two snippets together, the first in the .htaccess file, and the second in your PHP create an elegantly simple solution to arbitrary URLs with php. For a breakdown and example check out the link.
Don't want to follow the link, how about the q...
0
939
posted 12 years ago by FatFolderDesigner
Create variable named PHP variables. Having dynamically named variables can be helpful when dealing with loops and arrays. For example instead of having seven if () statements for handling seven individual days of the week, you could reduce it to one...
0
662
posted 12 years ago by dialeleven
This class is used to store global information for general access throughout the application.
0
763
posted 12 years ago by ryantxr
Sometimes it’s helpful to ONLY get numeric characters.
Phone numbers, age — whatever your little PHP heart desires.
0
1850
posted 12 years ago by satie83
Once in a while we need to check whether a string contains substring, some other string or characters or a value. Checking for existence of a string (or substring) inside another string is easier than it might seem. The following article describes ho...
0
891
posted 12 years ago by satie83
Auto language selection based on site languages and user preferences.
0
677
posted 12 years ago by Narayon