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
898
posted 12 years ago by iroybot
easy way of catching and displaying errors and return values from a exec() command back in PHP.
0
985
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
Load latest version of jQuery from Google Libraries API and de-register Wordpress version
0
1358
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
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
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
1064
posted 12 years ago by satie83
Auto language selection based on site languages and user preferences.
0
677
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
820
posted 12 years ago by pumpkinthehead
This will generate a random alpha numeric string 20 characters long.
1
1055
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
783
posted 12 years ago by TheNullByte
Extracts the video title & download URL from a youtube page and starts a download.
3
1431
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
609
posted 12 years ago by fmdfrank
when someone trying to or two conditions using active record database library in codeigniter
0
821
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
1086
posted 12 years ago by satie83