Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Show and hide content based on whether or not a user has clicked the 'Like' button of an app.
0
934
posted 13 years ago by the_construct
Getting files, folders, file count, folder count in a directory with php and writing them to a web page
1
1923
posted 13 years ago by duzenz
I like using public properties, as they greatly aid in API development and proper encapsulation. Here's my solution for having the ease of public variable getting without the dangers of public variable setting.
0
960
posted 13 years ago by phpexpert
Como parametro se tiene que tener la cantidad de meses que se desea sumar a la fehc a de inicio
0
875
posted 13 years ago by serialk89
This 'Check if HTTPS is on in PHP' script accounts for servers which set HTTPS differently. Some servers do not set HTTPS, others set it to 'off', etc. Only checking if HTTPS is on will cause an 'undefined index error' in these cases.
0
1169
posted 13 years ago by kf0l
A class i started to implement, which ended up in a working concept
However I'm not sure if it's a legal way of programming since I unnessesery
changes the structure of php without some real value except nicer structure
For now it remain a conce...
0
1027
posted 13 years ago by Knarf
Ordena Array Bidimensional Asociativo de acuerdo a parametro del array.
0
907
posted 13 years ago by serialk89
Condition = The condition which must be met.
True = Executed if the condition is met.
False = Executed if the condition failes.
0
860
posted 13 years ago by beneberle
Search for a string, if matched replace with second provided paramater. Third parameter is the variable whose value is the string you'd like to search.
0
1020
posted 13 years ago by inreflection7
Wordpress by default wraps images in <p> tags, this kills that.
3
1149
posted 13 years ago by rliverman
If the image source is not in the database a default image is displayed.
0
1603
posted 13 years ago by blantonious
Simple script utilising the `gpg_encrypt.php` code (`http://business-php.com/opensource/gpg_encrypt/`) that will encrypt both the body and attachment of an email on upload.
0
1331
posted 13 years ago by davo
Creates table structure for pitchfx data that is provided by mlb.com. Open PHP file and enter username and password for localhost. Feel free to customize to suit your preference.
0
1019
posted 13 years ago by wa-rufio
Open PHP file and enter User Credentials for localhost. The default dates are set to negotiate the 2011 season, but change the date variables to match your desired season data. The start date should be the day before opening day, and the end date t...
0
1066
posted 13 years ago by wa-rufio
Courtesy CSSTricks (http://css-tricks.com/snippets/wordpress/turn-on-more-buttons-in-the-wordpress-visual-editor/)
1
1067
posted 13 years ago by adambundy
UPDATE: might be easier or faster to use this now (also courtesy Pippin): http://pippinsplugins.com/get-all-attached-media/
**courtesy Pippin Williamson (http://pippinsplugins.com/image-gallery-short-code-using-post-attachments/)
use shortcode...
1
1123
posted 13 years ago by adambundy
dynamically selects a value in a select according to what's already in the DB
0
800
posted 13 years ago by dato
Use PHP to get JSON
1) set the PHP to the URL of the JSON
2) echo a variable with the loaded data
3) use a request via jQuery to get the variable from PHP
0
1090
posted 13 years ago by inreflection7
If you’ve ever wanted to display your latest Twitter tweets on a website, here is method to do that using PHP.
0
1152
posted 13 years ago by i-am-andy
This snippet shows a dynamic way to enable extra default include paths.
0
666
posted 13 years ago by tomcottrill
Set up a basic template:
<html>
<head>
<title>[[++site_name]] - [[*pagetitle]]</title>
<base>
<meta>​
</head>
<body>
[[*content]]
</body>
</html>
Content:
<div>
<h4>The ACME web site is currently under development</h4>
<p>Please...
0
752
posted 13 years ago by hotdiggity