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 1052 posted 12 years ago by iroybot
easy way of catching and displaying errors and return values from a exec() command back in PHP.
0 1125 posted 12 years ago by iroybot
A simple code to read/write an XML file by using Cakephp 1.3.
0 1212 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 705 posted 12 years ago by Gianino
Display Copyright
0 665 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 1174 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 917 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 1077 posted 12 years ago by FatFolderDesigner
Basic template for Joomla 2.5 with 3 columns
1 1109 posted 12 years ago by gradamedia
Show html on homepage and different html on other pages
0 1037 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 806 posted 12 years ago by dialeleven
This class is used to store global information for general access throughout the application.
0 940 posted 12 years ago by ryantxr
Load latest version of jQuery from Google Libraries API and de-register Wordpress version
0 1503 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 2073 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 1056 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 1218 posted 12 years ago by satie83
Auto language selection based on site languages and user preferences.
0 813 posted 12 years ago by Narayon
0 856 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 1006 posted 12 years ago by pumpkinthehead
This will generate a random alpha numeric string 20 characters long.
1 1277 posted 12 years ago by _reydin_
replace special characters
0 954 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 932 posted 12 years ago by TheNullByte
Extracts the video title & download URL from a youtube page and starts a download.
3 1595 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 727 posted 12 years ago by fmdfrank
when someone trying to or two conditions using active record database library in codeigniter
0 978 posted 12 years ago by pruntrut
http://www.binarymoon.co.uk/2009/10/timthumb-wordpress-mu/
0 874 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 1306 posted 12 years ago by satie83
HTTP headers to disable caching.
1 1130 posted 12 years ago by ryantxr
1 ... 7 8 9 10 11 ... 64