Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Traverses a multidimensional array and returns an array with the results. It also echoes the result as a string just for demonstration.
0
2734
posted 12 years ago by gummiost
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
1541
posted 12 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
1689
posted 12 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
2003
posted 12 years ago by satie83
Lists only certain files extensions as links on a page from a defined folder
1
3937
posted 12 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
2820
posted 12 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
4563
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
3065
posted 13 years ago by rickygri
поиÑк Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² многомерном маÑÑиве
0
1310
posted 13 years ago by noganno
I want to extract the numbers from a string that contains numbers and letters like
0
3478
posted 13 years ago by satie83
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
3442
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
2817
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
2021
posted 13 years ago by nshakin
A fast description of an sql cell with comparison and response.
0
1289
posted 13 years ago by cameronjrc
user modding for a forum based gaming website (file used in password protected directory)
0
1361
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
3363
posted 13 years ago by stianlagstad
This function mimics Photoshop overlay blending by accepting two RGB arrays, one which will be overlayed and one which will overlay. Opacity is optional.
0
1861
posted 13 years ago by laurikar
La función del SDKphp de facebook 'notifications' envia una notificación por parte de la aplicación al usuario que quieras (que haya aceptado tu aplicación).
0
1813
posted 13 years ago by serialk89
Here's the basic principal behind spiders. (ex: <a href="http://giochiflash.123homepage.it">Giochi Flash</a> $html = file_get_contents('http://www.example.com');
6
7732
posted 13 years ago by haydin
Validating an email address is one of the hardest feats on the web. A valid email can be marketing
gold, but an invalid email address is dead weight. Not only does it require a CPU-taxing PHP regular
expression ("/^[A-z0-9\._-]+"."@" . "[A-z0-9][A-...
1
2016
posted 13 years ago by mafhh14
This snippet is a lambda function (anonymous function) to create an xml from an array. It uses recursiveness.
1
3047
posted 13 years ago by abrahamsustaita
This example of code shows how to do a simple POST request in PHP to another web server by using a socket connection.
0
3620
posted 13 years ago by apphp-snippets
You need a copy of your model and relations (ObjectStorage properties).
In this example there is a model Product with property ProductAddition (1:n relation).
0
1825
posted 13 years ago by FazzyX