private function MakeWords($chunks)
	{
		$words = array();
		$index = 0;

		foreach ($chunks as $chunk)
		{
			$one = 		isset($chunk{0}) ? intval($chunk{0}) : null;
			$ten = 		isset($chunk{1}) ? intval($chunk{1}) : null;
			$hundred = 	isset($chunk{2}) ? intval($chunk{2}) : null;

			if ($index > 0)
			{
				$words[] = $this->thousands[$index - 1];
			}

			if (!is_null($ten) && $ten > 1)
			{
				if ($one != 0)
				{
					$words[] = $this->ones[intval(strval($ten) . '0')] . '-' . $this->ones[$one];
				}
				else
				{
					$words[] = $this->ones[$ten];
				}
			}
			else if (!is_null($ten))
			{
				if ($ten == 1)
				{
					$words[] = $this->ones[intval(strval($ten) . strval($one))];
				}
				else if ($ten == 0)
				{
					if ($one != 0)
					{
						$words[] = $this->ones[$one];
					}
				}
			}
			else if (is_null($ten))
			{
				if ($one != 0)
				{
					$words[] = $this->ones[$one];
				}
			}

			if (!is_null($hundred) && $hundred > 0)
			{
				$words[] = $this->ones[$hundred] . ' ' . $this->hundreds[0];
			}

			++$index;
		}

		$words = array_reverse($words);

		return implode(' ', $words);
	}
private function MakeWords($chunks)
	{
		$words = array();
		$index = 0;

		foreach ($chunks as $chunk)
		{
			$one = 		isset($chunk{0}) ? intval($chunk{0}) : null;
			$ten = 		isset($chunk{1}) ? intval($chunk{1}) : null;
			$hundred = 	isset($chunk{2}) ? intval($chunk{2}) : null;

			if ($index > 0)
			{
				$words[] = $this->thousands[$index - 1];
			}

			if (!is_null($ten) && $ten > 1)
			{
				if ($one != 0)
				{
					$words[] = $this->ones[intval(strval($ten) . '0')] . '-' . $this->ones[$one];
				}
				else
				{
					$words[] = $this->ones[$ten];
				}
			}
			else if (!is_null($ten))
			{
				if ($ten == 1)
				{
					$words[] = $this->ones[intval(strval($ten) . strval($one))];
				}
				else if ($ten == 0)
				{
					if ($one != 0)
					{
						$words[] = $this->ones[$one];
					}
				}
			}
			else if (is_null($ten))
			{
				if ($one != 0)
				{
					$words[] = $this->ones[$one];
				}
			}

			if (!is_null($hundred) && $hundred > 0)
			{
				$words[] = $this->ones[$hundred] . ' ' . $this->hundreds[0];
			}

			++$index;
		}

		$words = array_reverse($words);

		return implode(' ', $words);
	}
private function MakeWords ( $ chunks ) { $ words = array ( ) ; $ index = 0 ; foreach ( $ chunks as $ chunk ) { $ one = isset ( $ chunk { 0 } ) ? intval ( $ chunk { 0 } ) : null ; $ ten = isset ( $ chunk { 1 } ) ? intval ( $ chunk { 1 } ) : null ; $ hundred = isset ( $ chunk { 2 } ) ? intval ( $ chunk { 2 } ) : null ; if ( $ index > 0 ) { $ words [ ] = $ this -> thousands [ $ index - 1 ] ; } if ( ! is_null ( $ ten ) && $ ten > 1 ) { if ( $ one != 0 ) { $ words [ ] = $ this -> ones [ intval ( strval ( $ ten ) . '0' ) ] . '-' . $ this -> ones [ $ one ] ; } else { $ words [ ] = $ this -> ones [ $ ten ] ; } } else if ( ! is_null ( $ ten ) ) { if ( $ ten == 1 ) { $ words [ ] = $ this -> ones [ intval ( strval ( $ ten ) . strval ( $ one ) ) ] ; } else if ( $ ten == 0 ) { if ( $ one != 0 ) { $ words [ ] = $ this -> ones [ $ one ] ; } } } else if ( is_null ( $ ten ) ) { if ( $ one != 0 ) { $ words [ ] = $ this -> ones [ $ one ] ; } } if ( ! is_null ( $ hundred ) && $ hundred > 0 ) { $ words [ ] = $ this -> ones [ $ hundred ] . ' ' . $ this -> hundreds [ 0 ] ; } ++ $ index ; } $ words = array_reverse ( $ words ) ; return implode ( ' ' , $ words ) ; }
Takes an array of number chunks in string form and generates the
corresponding word forms of those chunks. It then reorganizes the
chunks into the correct order.

@param $chunks array[string]
@return string
Takes an array of number chunks in string form and generates the corresponding word forms of those chunks . It then reorganizes the chunks into the correct order .