PHP Classes
elePHPant
Icontem

File: src/Helpers/helpers.php

Recommend this page to a friend!
  Classes of Zacchaeus Bolaji  >  PHP Word to Number  >  src/Helpers/helpers.php  >  Download  
File: src/Helpers/helpers.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Word to Number
Convert a string with amount in words to a number
Author: By
Last change:
Date: 1 month ago
Size: 290 bytes
 

 

Contents

Class file image Download
<?php

if (! function_exists('word_to_number')) {
    function
word_to_number($word, $locale = 'en')
    {
       
$wordToNumber = new \Djunehor\Number\WordToNumber();
       
$transformer = $wordToNumber->getWordTransformer($locale);

        return
$transformer->toNumber($word);
    }
}