PHP correct use of plural

Source: Internet
Author: User

1<?PHP2 //display complex numbers correctly3 if(!function_exists(' _plurals_format '))4 {5     /**6 * Correct use of plural7 * @access Public8 * @author Zhaoyingnan 2016-02-17 11:539 * @param string $sPluralName a non-plural form nameTen * Number of @param int $iAmount One * @return String A * @note -      **/ -     function_plurals_format ($sPluralName,$iAmount) the     { -         if(!$sPluralName|| !Is_numeric($iAmount) ||$iAmount<= 0) -             return‘‘; -         //a special plural form +         $arPluralName=Array( -' Addendum ' = ' addenda ', +' Alga ' = ' algae ', A' Alumna ' = ' alumnae ', at' Alumnus ' = ' alumni ', -' Analysis ' = ' analyses ', -' Antenna ' = ' antennas ',//Antennae -' Apparatus ' = ' apparatuses ', -' Appendix ' = ' Appendices ',//appendixes -' Axis ' = ' axes ', in' Bacillus ' = ' bacilli ', -' bacterium ' = ' bacteria ', to' Basis ' = ' bases ', +' Beau ' = ' beaux ', -' Bison ' = ' bison ', the' Buffalo ' = ' buffalos ',//Buffaloes *' bureau ' = ' bureaus ', $' Bus ' = ' busses ',//BusesPanax Notoginseng' Cactus ' = ' cactuses ',//Cacti -' Calf ' = ' calves ', the' Child ' = ' children ', +' Corps ' = ' Corps ', A' Corpus ' = ' corpora ',//corpuses the' Crisis ' = ' crises ', +' Criterion ' and ' criteria ', -' Curriculum ' = ' curricula ', $' Datum ' = ' data ', $' Deer ' = ' deer ', -' Die ' = ' dice ', -' Dwarf ' = ' dwarfs ',//Dwarves the' Diagnosis ' = ' diagnoses ', -' echo ' = ' echoes ',Wuyi' Elf ' = ' elves ', the' Ellipsis ' = ' ellipses ', -' Embargo ' = ' embargoes ', Wu' Emphasis ' = ' emphases ', -' Erratum ' = ' errata ', About' Fireman ' = ' firemen ', $' Fish ' = ' fish ',//fishes -' Focus ' = ' focuses ', -' Foot ' = ' feet ', -' Formula ' = ' formulas ', A' Fungus ' = ' fungi ',//funguses +' Genus ' = ' genera ', the' Goose ' = ' geese ', -' Half ' = ' halves ', $' Hero ' = ' Heroes ', the' Hippopotamus ' = ' hippopotami ',//hippopotamuses the' Hoof ' = ' hoofs ',//Hooves the' Hypothesis ' = ' hypotheses ', the' Index ' = ' indices ',//Indexes -' Knife ' = ' knives ', in' leaf ' = ' leaves ', the' Life ' = ' lives ', the' Loaf ' = ' loaves ', About' louse ' = ' lice ', the' Man ' = ' men ', the' Matrix ' = ' matrices ', the' means ' = ' means ', +' Medium ' = ' media ', -' Memorandum ' = ' Memoranda ', the' Millennium ' = ' millenniums ',//MilenniaBayi' Moose ' = ' moose ', the' Mosquito ' = ' mosquitoes ', the' Mouse ' = ' mice ', -' Nebula ' = ' nebulae ',//Nebulas -' Neurosis ' = ' neuroses ', the' nucleus ' = ' nuclei ', the' Oasis ' = ' oases ', the' Octopus ' = ' octopi ',//Octopuses the' Ovum ' = ' ova ', -' Ox ' = ' oxen ', the' Paralysis ' = ' paralyses ', the' parenthesis ' = ' parentheses ', the' Person ' = ' people ',94' Phenomenon ' = ' phenomena ', the' Potato ' = ' potatoes ', the' Radius ' = ' radii ',//radiuses the' Scarf ' = ' scarfs ',//scarves98' Self ' = ' selves ', About' Series ' = ' series ', -' Sheep ' = ' sheep ',101' Shelf ' = ' shelves ',102' Scissors ' = ' scissors ',103' Species ' = ' species ',104' Stimulus ' = ' stimuli ', the' stratum ' = ' strata ',106' Syllabus ' = ' syllabi ',//syllabuses107' Symposium ' = ' Symposia ',//Symposiums108' Synthesis ' = ' syntheses ',109' Synopsis ' = ' synopses ', the' Tableau ' = ' tableaux ',111' That ' = ' those ', the' Thesis ' = ' Theses ',113' Thief ' = ' thieves ', the' This ' = ' these ', the' Tomato ' = ' tomatoes ', the' tooth ' = ' teeth ',117' Torpedo ' = ' torpedoes ',118' Vertebra ' = ' vertebrae ',119' Veto ' = ' vetoes ', -' Vita ' = ' vitae ',121' Watch ' = ' watches ',122' Wife ' = ' wives ',123' Wolf ' = ' wolves ',124' Woman ' = ' women ', the' Zero ' = ' zeros ',//Zeroes126         );127  -         //If there is only one129         if($iAmount= = 1) the             return $sPluralName;131  the         //if more than one, and is a special plural form133         if(isset($arPluralName[$sPluralName]))134             return $arPluralName[$sPluralName];135 136         //more than one, and is a standard plural form137         return $sPluralName.‘ S;138     }139 } $ 141 Echo' Sybil ate three '. _plurals_format (' Biscuit ', 3). ', one after the other. ',Php_eol;142 Echo' The ' _plurals_format (' Woman ', 2). ' Would meet tomorrow in the final ';

PHP correct use of plural

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.