/*********************************************************************
**
** Class format_num
**
** Author...: leapinglangoor [ leapinglangoor@gmail.com ]
** Date.....: 19 April 2005
** Version..: v1.1
**
** Desc.....: This class is used to format a string to
** a particualr format which are passed as
** arguments. The class is basically one functioned
** which has been made the constructor. Send the
** the values in the order of $string, $format.
**
** Examples.: format_num( '91809901689', '+00 00 000-0000' );
** will return '+91 80 990-1689';
**
** format_num( '12625828747', '+42-21=38(12)[123]' );
** will return '+12-62=58(28)[747]';
**
*********************************************************************/
class format_num
{
/*******************************************
**
** @constructor format_num
**
** Args - string $string, string $format
** returns string
**
** Simple function, traverses $format
** replaces any numeric value with it's
** corresponding value in $string and leaves
** any other charachter as is.
**
*********************************************/
function format_num($string, $format)
{
if ($format == '') return 0;
if ($string == '') return 0;