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 686 posted 11 years ago by iroybot
easy way of catching and displaying errors and return values from a exec() command back in PHP.
0 815 posted 11 years ago by iroybot
A simple code to read/write an XML file by using Cakephp 1.3.
0 860 posted 11 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 461 posted 11 years ago by Gianino
Display Copyright
0 415 posted 11 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 827 posted 11 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 669 posted 11 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 755 posted 11 years ago by FatFolderDesigner
Basic template for Joomla 2.5 with 3 columns
1 746 posted 11 years ago by gradamedia
Show html on homepage and different html on other pages
0 729 posted 11 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 515 posted 11 years ago by dialeleven
This class is used to store global information for general access throughout the application.
0 594 posted 11 years ago by ryantxr
Load latest version of jQuery from Google Libraries API and de-register Wordpress version
0 1180 posted 11 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 1602 posted 11 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 724 posted 11 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 878 posted 11 years ago by satie83
Auto language selection based on site languages and user preferences.
0 533 posted 11 years ago by Narayon
0 539 posted 11 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 615 posted 11 years ago by pumpkinthehead
This will generate a random alpha numeric string 20 characters long.
1 839 posted 11 years ago by _reydin_
replace special characters
0 681 posted 11 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 624 posted 11 years ago by TheNullByte
Extracts the video title & download URL from a youtube page and starts a download.
3 1204 posted 11 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 479 posted 11 years ago by fmdfrank
when someone trying to or two conditions using active record database library in codeigniter
0 656 posted 11 years ago by pruntrut
http://www.binarymoon.co.uk/2009/10/timthumb-wordpress-mu/
0 563 posted 11 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 850 posted 11 years ago by satie83
HTTP headers to disable caching.
1 785 posted 11 years ago by ryantxr
1 ... 7 8 9 10 11 ... 64