1
2
3
4
<?php
/*
E.g:
...

PHP remove http from url string

by armano.myopenid.com, November 11, 2008 04:09, 6 refactorings, tagged with short url, url, remove http

Ive made a function simply ...

1cd9c8984f2fdeb996130d54d62a98d9 Talk
1
2
3
<?php
$player_1_bet = 12; // ALL IN
...

PHP Poker Side Pots

by extjspoker, October 28, 2008 17:03, 2 refactorings, tagged with php, poker

So I don't currently have a...

4b3c8b874641c3398f7aae0be9873163 Talk
1
2
3
4
<?php

// Example Usage: array_to_tablerows(array('x', 'x', 'x', 'x', 'x', 'x'), 4);
...

PHP Array To Tablerows

by section31, October 25, 2008 06:23, 6 refactorings

Coverts an Array of Values ...

1fd195404fcc209f9d9594d92b33de0a Talk
1
2
3
4
#!/usr/bin/php
<?php
/**
...

PHP HTML Filter

by grom, October 23, 2008 23:00, 1 refactoring, tagged with php, html, parser, sanitize

Only allow subset of HTML. ...

A14537020ec5b11fea3b956353724860 Talk
1
2
3
4
<?php
function unique_file($prefix, $suffix){
  $file = sprintf('%s.%s', $prefix, $suffix);
...

PHP Generate a numbered file name

by hubfactor, October 23, 2008 13:53, 2 refactorings, tagged with file

Create a file name from the...

Ed9c50a6db8b5e078b5ef84306a8477c Talk
1
2
3
4
function get_next_seat($table_id, $start_seat) {
		$player_data = $this->admin->get_player_data($table_id);
		
...

PHP Get Next Turn

by extjspoker, October 21, 2008 22:55, 5 refactorings, tagged with php, poker

The below function is used ...

4b3c8b874641c3398f7aae0be9873163 Talk
1
2
3
4
define("MAX_INFO_SIZE",500);
define("MAX_DATA_SIZE",100000);
define("MAX_THUMBNAIL_SIZE",10000);
...

PHP file upload validation

by lajos, October 02, 2008 04:52, 4 refactorings, tagged with upload, validation

This function validates fil...

Avatar Talk
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, 4 refactorings

How would you refactor this...

9dc24638923a6aee9fd3571c14f01066 Talk
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...

71367d98df2bf14cbf704e7741eb402d Talk
1
2
3
4
<?php
class PropertyHandler 
{
...

PHP Base class for easy class p...

by antelopelovefan.com/id, August 28, 2008 12:35, 2 refactorings, tagged with php class properties

This class lets you handle ...

040ffc7f3327b05f01c54a8bef3ba60a Talk
1
2
3
<?php
function loadModel($model)
...

PHP model loader

by Ishkur, August 21, 2008 14:16, 5 refactorings, tagged with model loading

I'm doing a lot of work wit...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk
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...

151e36cc7f789a4790c8ca437e3a1f60 Talk
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

by Juha Hollanti, August 13, 2008 11:50, 3 refactorings, tagged with php, image

The built in image function...

A623216a5d2384489e012478c555d167 Talk
1
2
3
4
	public function setClass($class){
		switch($class){
			case "050":
...

PHP switch statement a good idea?

by cmcculloh, August 12, 2008 18:19, 5 refactorings, tagged with case, switch, php

I'm making a switch stateme...

298e0497aa6b76a573f17e6a2bb22dec Talk
1
2
3
4
<?php

$payload = array(array(
...

PHP Array and ForEach Loop

by goodespeler.myopenid.com, August 12, 2008 17:45, 1 refactoring, tagged with array, foreach, loop

Hi. I'm constructing an XML...

B04f7f475867f6b47a59b49dfabc0daf Talk
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...

B04f7f475867f6b47a59b49dfabc0daf Talk
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...

1e6b9d50678a0cc32d98aa1dd1ec3846 Talk
1
2
3
4
<?php
# file:  User_class.php
class User extends DatabaseConnectable
...

PHP objects that deliver format...

by bobobobo, August 01, 2008 13:50, 3 refactorings, tagged with php weird ideas

Hi guys,

I'm trying writ...

A4ec51727310397c9e592dd84ae74dc2 Talk
1
2
3
+----------+-------------+------+-----+---------+----------------+
| Field    | Type        | Null | Key | Default | Extra          |
...

PHP Object with Field names as ...

by Ishkur, July 28, 2008 19:35, 6 refactorings, tagged with php5, field names, database, object

What I am trying to do is a...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk
1
2
3
4
<?php

class DB {
...

PHP PHP5 Database Clas

by Ishkur, July 21, 2008 16:33, 3 refactorings, tagged with php5, database, class

For the most part, this cla...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk
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'...

A623216a5d2384489e012478c555d167 Talk
1
2
3
4
class DB {
        /*
        $c=new DB();
...

PHP Database Class

by seal-7.blogspot.com, July 09, 2008 17:47, 4 refactorings, tagged with database, php

We use this class in 1000's...

Avatar Talk
1
2
3
4
<?php

/**
...

PHP Interfacing Tor with cURL

by Ishkur, June 28, 2008 20:29, 2 refactorings, tagged with Tor, OOP Class, php

I found a php function that...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk
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...

42e1363a474387e41af8f8219797e112 Talk
1
2
3
4
class XML_QNC
 {
  private $reader   = "";
...

PHP XMLReader to Array Class

by ellisgl.myopenid.com, June 12, 2008 22:28, 4 refactorings, tagged with php, xml, class

XMLReader is fast and uses ...

8bba46dba9043c254e6eef1aa664e6f0 Talk