downloads | documentation | faq | getting help | mailing lists | reporting bugs | sites | links | my 
search for in the  
<Using PHP from the command lineApache>
view the version of this page
Last updated: Thu, 21 Aug 2003

V. Function Reference

Table of Contents
I. Apache-specific Functions
II. Array Functions
III. Aspell functions [deprecated]
IV. BCMath Arbitrary Precision Mathematics Functions
V. Bzip2 Compression Functions
VI. Calendar functions
VII. CCVS API Functions
VIII. COM support functions for Windows
IX. Class/Object Functions
X. ClibPDF functions
XI. Crack functions
XII. CURL, Client URL Library Functions
XIII. Cybercash payment functions
XIV. Cyrus IMAP administration functions
XV. Character type functions
XVI. Database (dbm-style) abstraction layer functions
XVII. Date and Time functions
XVIII. dBase functions
XIX. DBM Functions [deprecated]
XX. dbx functions
XXI. DB++ Functions
XXII. Direct IO functions
XXIII. Directory functions
XXIV. DOM XML functions
XXV. .NET functions
XXVI. Error Handling and Logging Functions
XXVII. FrontBase Functions
XXVIII. filePro functions
XXIX. Filesystem functions
XXX. Forms Data Format functions
XXXI. FriBiDi functions
XXXII. FTP functions
XXXIII. Function Handling functions
XXXIV. Gettext
XXXV. GMP functions
XXXVI. HTTP functions
XXXVII. Hyperwave functions
XXXVIII. Hyperwave API functions
XXXIX. iconv functions
XL. Image functions
XLI. IMAP, POP3 and NNTP functions
XLII. Informix functions
XLIII. InterBase functions
XLIV. Ingres II functions
XLV. IRC Gateway Functions
XLVI. PHP / Java Integration
XLVII. LDAP functions
XLVIII. Mail functions
XLIX. mailparse functions
L. Mathematical Functions
LI. Multi-Byte String Functions
LII. MCAL functions
LIII. Mcrypt Encryption Functions
LIV. MCVE Payment Functions
LV. Mhash Functions
LVI. Mimetype Functions
LVII. Microsoft SQL Server functions
LVIII. Ming functions for Flash
LIX. Miscellaneous functions
LX. mnoGoSearch Functions
LXI. mSQL functions
LXII. MySQL Functions
LXIII. Improved MySQL Extension
LXIV. Mohawk Software session handler functions
LXV. muscat functions
LXVI. Network Functions
LXVII. Ncurses terminal screen control functions
LXVIII. Lotus Notes functions
LXIX. NSAPI-specific Functions
LXX. Unified ODBC functions
LXXI. Object Aggregation/Composition Functions
LXXII. Oracle 8 functions
LXXIII. OpenSSL functions
LXXIV. Oracle functions
LXXV. Ovrimos SQL functions
LXXVI. Output Control Functions
LXXVII. Object property and method call overloading
LXXVIII. PDF functions
LXXIX. Verisign Payflow Pro functions
LXXX. PHP Options&Information
LXXXI. POSIX functions
LXXXII. PostgreSQL functions
LXXXIII. Process Control Functions
LXXXIV. Program Execution functions
LXXXV. Printer functions
LXXXVI. Pspell Functions
LXXXVIII. GNU Recode functions
LXXXIX. Regular Expression Functions (Perl-Compatible)
XC. qtdom functions
XCI. Regular Expression Functions (POSIX Extended)
XCII. Semaphore, Shared Memory and IPC Functions
XCIII. SESAM database functions
XCIV. Session handling functions
XCV. Shared Memory Functions
XCVII. Shockwave Flash functions
XCVIII. SNMP functions
XCIX. Socket functions
C. Stream functions
CI. String functions
CII. Sybase functions
CIII. Tokenizer functions
CIV. URL Functions
CV. Variable Functions
CVI. vpopmail functions
CVII. W32api functions
CVIII. WDDX Functions
CIX. XML parser functions
CX. XML-RPC functions
CXI. XSLT functions
CXII. YAZ functions
CXIII. YP/NIS Functions
CXIV. Zip File Functions (Read Only Access)
CXV. Zlib Compression Functions

add a note add a note User Contributed Notes
Function Reference
master at dreamphp dot com
28-Oct-2003 11:08
// kill-time. complicatedly source ... ^^;;;

function roma_to_number ($string) {
  $len = strlen($string);
  $sum = 0;
  for ($i=0;$i<$len;$i++) {
    switch ( $string{$i} ) {
      case 'I': // 1
      case 'V': // 5
        if ( $string{$i-1} == 'I' ) $sum+=3;
        else                        $sum+=5;
      case 'X': // 10
        if ( $string{$i-1} == 'I' ) $sum+=8;
        else                        $sum+=10;
      case 'L': // 50
        if ( $string{$i-1} == 'X' ) $sum+=30;
        else                        $sum+=50;
      case 'C': // 100
        if ( $string{$i-1} == 'X' ) $sum+=80;
        else                        $sum+=100;
      case 'D': // 500
        if ( $string{$i-1} == 'C' ) $sum+=300;
        else                        $sum+=500;
      case 'M': // 1000
        if ( $string{$i-1} == 'C' ) $sum+=800;
        else                        $sum+=1000;

  return $sum;

// example
echo roma_to_number('MCMXCVIII').'-'.roma_to_number('MMIII');
// output 1998-2003
philip at cornado dot com
31-Jul-2001 09:39
Function Quick Reference :

<Using PHP from the command lineApache>
 Last updated: Thu, 21 Aug 2003
show source | credits | sitemap | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Sat 01 Nov 2003 04:13:36 EST EST