Welcome To Snipplr


Everyone's Recent Snippets Tagged php



1 ... 7 8 9 10 11 ... 64
easy way of catching and displaying errors and return values from a exec() command back in PHP.
0 900 posted 12 years ago by iroybot
easy way of catching and displaying errors and return values from a exec() command back in PHP.
0 991 posted 12 years ago by iroybot
A simple code to read/write an XML file by using Cakephp 1.3.
0 1044 posted 12 years ago by tucq88
Reduces the string size according to the parameter that has been send and put '...' at the end of the new string
0 588 posted 12 years ago by Gianino
Display Copyright
0 551 posted 12 years ago by evinweissenberg
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 1014 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 800 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 941 posted 12 years ago by FatFolderDesigner
Basic template for Joomla 2.5 with 3 columns
1 944 posted 12 years ago by gradamedia
Show html on homepage and different html on other pages
0 889 posted 12 years ago by morktron
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 670 posted 12 years ago by dialeleven
This class is used to store global information for general access throughout the application.
0 768 posted 12 years ago by ryantxr
Load latest version of jQuery from Google Libraries API and de-register Wordpress version
0 1361 posted 12 years ago by i-am-andy
Sometimes it’s helpful to ONLY get numeric characters. Phone numbers, age — whatever your little PHP heart desires.
0 1852 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 893 posted 12 years ago by satie83
In javascript there is no function for printing variables like you have PHP, I use print_r and var_dump a lot in PHP for dumping variables so I wanted to create a simular function in javascript.
0 1068 posted 12 years ago by satie83
Auto language selection based on site languages and user preferences.
0 679 posted 12 years ago by Narayon
0 715 posted 12 years ago by pruntrut
A regular expression for removing <br> and <br> (case insensitive) between HTML elements if there is no content between the HTML elements. It was written for fixing extra line spaces created in a WordPress visual editor after the content of the visu...
0 827 posted 12 years ago by pumpkinthehead
This will generate a random alpha numeric string 20 characters long.
1 1060 posted 12 years ago by _reydin_
replace special characters
0 825 posted 12 years ago by Narayon
Just a small function to sanitize the user's input of any xss and sqli. I saw a lot of ones that didn't include htmlentities or htmlspecialchars, and were still vulnerable to persistent/reflected xss.
1 786 posted 12 years ago by TheNullByte
Extracts the video title & download URL from a youtube page and starts a download.
3 1433 posted 12 years ago by codespartan
For a project I needed to generate a unique code for each user the client would input manually. Each user would have four fields (first name, last name, email, zipcode). Omitting the email addresses ensures unique output because we reduce the chances...
0 612 posted 12 years ago by fmdfrank
when someone trying to or two conditions using active record database library in codeigniter
0 822 posted 12 years ago by pruntrut
http://www.binarymoon.co.uk/2009/10/timthumb-wordpress-mu/
0 745 posted 12 years ago by rabc
Example calculate yesterday, but if you multiply by some number you can get in an easy way, weeks, months or years
0 1091 posted 12 years ago by satie83
HTTP headers to disable caching.
1 980 posted 12 years ago by ryantxr
1 ... 7 8 9 10 11 ... 64