This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A test of a gist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Hello World\n"; | |
# author : me | |
# purpose : a test gist | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Shows all information, defaults to INFO_ALL | |
phpinfo(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Singleton | |
{ | |
protected static $instance = null; | |
protected function __construct() | |
{ | |
# Thou shalt not construct that which is unconstructable! | |
} | |
protected function __clone() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ====================================================== | |
PHP Calculator example using "sticky" form (Version 2) | |
====================================================== | |
- uses a dropdown select box to select operation | |
- does very basic validation | |
- uses a function to calculate result | |
- traps a devide by zero error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<quotes> | |
<quote><text category="romantic">There is no remedy but to love more.</text> | |
<source>Henry David Thoreau</source> | |
<dob-dod>1817-1862</dob-dod> | |
<wplink>http://en.wikipedia.org/wiki/Henry_David_Thoreau</wplink> | |
<wpimage>http://upload.wikimedia.org/wikipedia/commons/f/f0/Benjamin_D._Maxham_-_Henry_David_Thoreau_-_Restored.jpg</wpimage> | |
</quote><quote><text category="romantic">There is always some madness in love. But there is also always some reason in madness.</text> | |
<source>Friedrich Nietzsche</source> | |
<dob-dod>1844-1900</dob-dod> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# always include this line | |
@date_default_timezone_set("GMT"); | |
#declare the currency array | |
$ccodes = array( | |
'AUD','BRL','CAD','CHF', | |
'CNY','DKK','EUR','GBP', | |
'HKD','HUF','INR','JPY', | |
'MXN','MYR','NOK','NZD', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# always include this line | |
@date_default_timezone_set("GMT"); | |
#declare the currency array | |
$ccodes = array( | |
'AUD','BRL','CAD','CHF', | |
'CNY','DKK','EUR','GBP', | |
'HKD','HUF','INR','JPY', | |
'MXN','MYR','NOK','NZD', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# always include this line | |
@date_default_timezone_set("GMT"); | |
#declare the currency array | |
$ccodes = array( | |
'AUD','BRL','CAD','CHF', | |
'CNY','DKK','EUR','GBP', | |
'HKD','HUF','INR','JPY', | |
'MXN','MYR','NOK','NZD', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# error_hash to hold error numbers and messages | |
# must be kept in the config file | |
$error_hash = array( | |
1000 => 'Currency type not recognized', | |
1100 => 'Required parameter is missing', | |
1200 => 'Parameter not recognized', | |
1300 => 'Currency amount must be a decimal number', | |
1400 => 'Error in service', |
OlderNewer