/** * Should Work! Fixed bug with numbers between(inclusive) 1 and 19 * Adding array output Instead of simple output, this eases advanced programming */ class numberToWord{ /** Connects to the webservice @var soapClient */ public $ws; public $serverId; /** This is to call hidden functions */ public function __call($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to call functions using old code */ public function __soapCall($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to set cookie values functions */ public function setCookies($cookies_csv){ if($cookies_csv != null){ $splitCookies = explode(",",$cookies_csv); foreach($splitCookies as $currentCookie){ $subSplit= explode("=",$currentCookie); $this->ws->__setCookie($subSplit[0], $subSplit[1]); } } } public function __construct($cookies_csv=null){ $this->serverId="http://soap.peterdownie.com/webServices/convertNumbersToWordFormat/server.php"; $this->ws = new SoapClient(null,array("uri"=>"$this->serverId","location"=>"$this->serverId")); $this->setCookies($cookies_csv); return $this->ws->__soapCall("__construct",array()); } /** Convert nuumber to their word format takes a number and converts it to a readable number! 1 = one, ... Currently only does integers, there is a limit of 10 to the power of 45(Approx) */ public function convertNumberToWordFormat($number){ return $this->ws->__soapCall("convertNumberToWordFormat",array($number)); } }