Welcome To Snipplr


Everyone's Recent Snippets Tagged php



1 2 3 4 5 6 7 ... 63
Truncates the given string at the specified length.
1 2116 posted 12 years ago by JoshChris
Bare outline for a PHPUnit test case
0 1573 posted 12 years ago by steroidmonkey
Covnerts an IP address to it's relative hex value.
0 5094 posted 13 years ago by martyncoup
Simple PHP functions to validate username, password and date, functions check the input format and allowed characters and then return TRUE for valid data and FALSE for invalid data.
0 5219 posted 13 years ago by codingforever99
<a href="http://pantuts.com/2013/10/24/ayeemtract-using-curl-parallel/">http://pantuts.com/2013/10/24/ayeemtract-using-curl-parallel/</a>
1 4021 posted 13 years ago by pantuts
How to build a login form using php with mysql database.
0 2155 posted 13 years ago by codingforever99
simple php file uploader with check for file extension and size.
0 3216 posted 13 years ago by codingforever99
Here's a country list with continent and country by country code!
0 3746 posted 13 years ago by kilise
By default Apache won't allow you to download a file over 2GB. This PHP script overcomes that along with some extra goodies. The script will read from standard url path the file on the server to download and display the filesize along with a link...
1 3522 posted 13 years ago by deanhouseholder
Traverses a multidimensional array and returns an array with the results. It also echoes the result as a string just for demonstration.
0 2998 posted 13 years ago by gummiost
This will print out a variable to a <pre>
0 1901 posted 13 years ago by brownrl
Generate a generic file comment
0 2888 posted 13 years ago by brownrl
Generate a generic function comment block
0 1726 posted 13 years ago by brownrl
This is a quick sublime snippet to quickly setup a DB table for pagination. Ideally from here you will be into a smarty template.
0 1728 posted 13 years ago by brownrl
When using PDO with sQlite ->rowCount() doesn't work. the recommendation is to do a pre query to get the number. Thus, I created this snippet to help things along.
0 1894 posted 13 years ago by brownrl
Der folgende Codeschnipsel enthält keinerlei Überprüfungen der übergebenen Parameter, diese sollten für den produktiven Einsatz noch nachgepflegt werden. Wie man sieht, ist die Berechnung von Wochendenden und Feiertagen recht einfach. Diese Ber...
1 2230 posted 13 years ago by satie83
Lists only certain files extensions as links on a page from a defined folder
1 4256 posted 13 years ago by kidmizere
Doing the echo with multiple concatenated bits of strings was very error prone and I was always getting parsing errors. The toggle format where you flip PHP on and off throughout the HTML is less error prone but is a real pain in the ass if you have...
0 3060 posted 13 years ago by COBOLdinosaur
Check if current post type is a custom post type – WordPress. Returns a true/false-statement. Can be used outside The Loop.
0 4909 posted 13 years ago by jonasethomsen
This function can be used to check if a file exists using the HTTP header response. Example use, when looping through cached JSON objects (instagram API, etc.)
0 3306 posted 13 years ago by rickygri
поиск значения в многомерном массиве
0 1491 posted 13 years ago by noganno
I want to extract the numbers from a string that contains numbers and letters like
0 3767 posted 13 years ago by satie83
Sanitize database inputs
0 1487 posted 13 years ago by mrglazzz
Breaks up an address (in this case returned by Advanced Custom Fields Location plugin) into it's components. Additionally, sorts a multidimensional array of locations alphabetically by state. This works for basic addresses assuming that address is in...
1 3725 posted 13 years ago by devowhippit
Returns array with information like: Input image width 200 height 200 print_r(ratioResize('path/to/image.ext' , 100 , 50)); output: array( [ratio] => .5, [height] => 50, [width] => 50,...
0 3051 posted 13 years ago by ShawnG
PHP function to save an image from a remote source then download it to the local server that the script is on.
0 2246 posted 13 years ago by nshakin
A fast description of an sql cell with comparison and response.
0 1454 posted 13 years ago by cameronjrc
user modding for a forum based gaming website (file used in password protected directory)
0 1544 posted 13 years ago by cameronjrc
This simple functions scans the user agent for the word "android" and returns true if found. Useful if there's something you only want android visitors to see (or not see).
0 3638 posted 13 years ago by stianlagstad
Validate the credit card number is valid or not
1 3297 posted 13 years ago by satinfo30
1 2 3 4 5 6 7 ... 63