/[cvs]/nfo/php/libs/org.netfrag.flib/utils/helper.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.flib/utils/helper.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by joko, Mon Mar 3 21:21:43 2003 UTC revision 1.9 by jonen, Tue Sep 7 18:52:01 2004 UTC
# Line 3  Line 3 
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  //  //
# Line 85  function isvalidemailaddress($mail) { Line 88  function isvalidemailaddress($mail) {
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";
# Line 157  function number_format_locale1($string) Line 160  function number_format_locale1($string)
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    
# Line 172  function is_amount($amount) { Line 176  function is_amount($amount) {
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  ?>  ?>

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed