I can’t remember when I wrote this but I found this little snippet in my library and didn’t want it to go to waste. It’s very simple and just uses Yahoo! Finance to get the quote. To use the Class simply use the below code: 1 2 $currency = new Currency(); print_r($currency->convert(’USD’, ‘JPY’, 100)); It [...]
Posts Tagged ‘PHP’
PHP – Binary Bayesian Filter
This is a simple Binary Bayesian Filter. The reason for the Interfaces and Abstract classes is because I am still mid-ways through my Java to PHP port Also notice that this model calculates P(A|B) by assigning probability values rather than frequency counts. P(A|B) = P(A & B) / P(B) Sample Usage 1 2 3 4 [...]
PHP – Base 2, 8, 16, 62, N Conversion
A simple class that can easily be used to convert between Base10 and any other Base. Base2.php 1 2 3 4 5 6 7 8 9 <?php class Base2 extends BaseN { public function __construct() { parent::__construct(2, ’01′); } } Base8.php 1 2 3 4 5 6 7 8 9 <?php [...]
PHP Timer Class
A small timer class I wrote: Timer.php 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 [...]
PHP – Logger
Mainly written for fun, but this is a configurable Logger written in PHP that supports multiple handlers, including Writers (File, SQL, Apache’s Error Log, Echo), configurable Formatting. various logging levels (FATAL, ERROR, WARN, INFO, DEBUG, TRACE). Also useful functions like isDebug/TraceEnabled(), to check before building large strings to debug/trace(). *While each logger instance can have [...]


Posted in
Tags:

