3 |
// $Id$ |
// $Id$ |
4 |
// ----------------------------------------------------------------------------- |
// ----------------------------------------------------------------------------- |
5 |
// $Log$ |
// $Log$ |
6 |
|
// Revision 1.9 2004/09/07 18:52:01 jonen |
7 |
|
// added function 'format_amount' |
8 |
|
// |
9 |
// Revision 1.8 2003/03/03 21:21:43 joko |
// Revision 1.8 2003/03/03 21:21:43 joko |
10 |
// refactored most reusable code to org.netfrag.glib/php_extensions.php |
// refactored most reusable code to org.netfrag.glib/php_extensions.php |
11 |
// |
// |
88 |
if( !eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*"."@([a-z0-9]+([\.-][a-z0-9]+))*$",$mail, $regs) ) { |
if( !eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*"."@([a-z0-9]+([\.-][a-z0-9]+))*$",$mail, $regs) ) { |
89 |
return "format"; |
return "format"; |
90 |
} |
} |
91 |
elseif( gethostbyname($regs[2]) == $regs[2] ) { |
elseif( gethostbynamel($regs[2]) == $regs[2] ) { |
92 |
return "host"; |
return "host"; |
93 |
} |
} |
94 |
return "valid"; |
return "valid"; |
160 |
|
|
161 |
function number_format_locale ($num, $decimals = null) { |
function number_format_locale ($num, $decimals = null) { |
162 |
$locale = localeconv(); |
$locale = localeconv(); |
163 |
if(!isset($decimals)) $decimals = $locale['frac_digits']; |
//if(!isset($decimals)) $decimals = $locale['frac_digits']; |
164 |
|
if(!isset($decimals)) $decimals = 2; |
165 |
return number_format($num, $decimals, $locale['decimal_point'], $locale['thousands_sep']); |
return number_format($num, $decimals, $locale['decimal_point'], $locale['thousands_sep']); |
166 |
} |
} |
167 |
|
|
176 |
} |
} |
177 |
} |
} |
178 |
|
|
179 |
|
function format_amount(&$amount) { |
180 |
|
$amount = str_replace(array(".", ","), array("", "."), $amount); |
181 |
|
//print "streplace amount: '$amount'<br>"; |
182 |
|
//return $amount; |
183 |
|
} |
184 |
|
|
185 |
|
|
186 |
?> |
?> |