1 2 3 4
define("MAX_INFO_SIZE",500);
define("MAX_DATA_SIZE",100000);
define("MAX_THUMBNAIL_SIZE",10000);
...
1 2 3 4
function amortization_array($principal, $interest_rate, $start_year, $start_month, $term, $group_by = 'M, Y', $month_names){
$periods = $term * 12;
$balance = $principal;
...
PHP Mortgage Calculator
by jcapote,
September 24, 2008 23:27,
3 refactorings
How would you refactor this...
1 2 3 4
function create_link($string) {
$input = media_title($string);
...
PHP Prepare links - friendly URLs
by Memf,
September 04, 2008 05:57,
2 refactorings, tagged with php, short, friendly, friendly urls, url, URLs, prepare, code, memforis, function, memf, links, create link
Please help shorten the cod...
1 2 3 4
<?php class PropertyHandler { ...
PHP Base class for easy class p...
This class lets you handle ...
1 2 3 4
public function setClass($class){
switch($class){
case "050":
...
PHP switch statement a good idea?
I'm making a switch stateme...
1 2 3 4
/** * Scale an image according to input canvas dimensions. * No cropping will occur, the scaled image is "centered" to canvas. ...
PHP Resize image to canvas
The built in image function...
1 2 3 4
<?php class RequestFile ...
PHP Universal File Download Class
by Chris Dean,
August 16, 2008 11:21,
3 refactorings, tagged with php, 5, universal, file, download, class
After finding different hos...
1 2 3 4
<?php class ccForm ...
PHP Getter and Setter
by goodespeler.myopenid.com,
August 08, 2008 14:33,
7 refactorings, tagged with getter, setter, security
I'm new to the concept of g...
1 2 3 4
<?php abstract class mySQL // abstract => cannot be instanciated ...
PHP MySQL original PHP 5 wrappe...
by TiTi,
August 01, 2008 20:44,
7 refactorings, tagged with mysql, wrapper, object, php5, static, const, student, titi
Typical MySQL wrapper writt...
1 2 3
+----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | ...
PHP Object with Field names as ...
What I am trying to do is a...
1 2 3 4
<?php # file: User_class.php class User extends DatabaseConnectable ...
PHP objects that deliver format...
Hi guys,
I'm trying writ...
1 2 3 4
/** * Split the supplied timestamp string, add the seconds and concatenate the whole thing back into timestamp format. * Note! that the mktime function will perform even if the supplied amount of seconds exceeds 59. It just adds them ...
PHP Adding seconds to a MySQL t...
by Juha Hollanti,
July 14, 2008 13:38,
4 refactorings, tagged with php, mysql timestamp, conversion, add seconds
Suggestions are welcome. I'...
1 2 3 4
class XML_QNC
{
private $reader = "";
...
PHP XMLReader to Array Class
XMLReader is fast and uses ...
1 2 3 4
static public function invoke($hook) {
$packages = array();
$results = array();
...
PHP Dynamically invoking static...
Hey guys, I should have rea...
1 2 3 4
<?php /* * This is a test of a rules based iterative algorithm... ...
PHP Rules Based Iterator
by James Stansfield,
June 15, 2008 13:52,
1 refactoring, tagged with php, loop, iterate, rules, array
I had need for an iterative...
1 2 3 4
<?php if (count($argv) != 3) die("Usage: $argv[0] <RSS feed URL> <output dir>\n"); ...
PHP Download all audio enclosur...
Given an RSS feed and an ou...
1 2 3 4
<?php $std = fopen("php://stdin", "r"); echo "TICTACTOE\n\n\n\n"; ...
PHP Command-Line TicTacToe
Just wondering if there are...
1 2 3 4
<?php function imagetrim(&$im){ ...
PHP Trim an image vertically
Originally from http://zava...
This function validates fil...