Welcome To Snipplr
Everyone's Recent Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
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
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
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
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_
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
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