How to write a program that will return numbers when user enter some string like two thirty,it must return 230 as output?
Now you're talking language processing, because a user could type 'two thirty', 'two hundred thirty', 'two-thirty', etc. If you want to interpret it literally as 'two' followed by 'thirty' then you could just replace each number with its digit equivalent. e.g. two => 2, thirty => 30 Would cause issues with 'two thirty two' though, you'd end up with 2302. Hence the language processing issue.
then what happens when user types two hundred thirty two?I want that when user types two thirty two ten then 232 gets multiplies by 10 and displays the result i.e 2320.help me regarding this
As James said, you have to write a language processor. That's not something someone can post the code for here - a language processor that can handle human language is a lot more complex than, say, a processor to handle a computer language like PHP.
Learn how to write a human language processor. It should take about a year or two of full-time study. (IOW, this is not a trivial task.)
A "number" like "two hundred thirty" is human, or "natural", language, unlike 230, which is something a computer can read with no help. You need a program that can read that and figure out what the person who entered it meant. The person could enter "two thirty", "two hundred thirty", "two hundred and thirty", etc., and they're all 230. Writing a program like that will take you a very long time (a year or so if you include the time it will take you to learn enough about programming to do it), so I don't recommend that you even try until you've learned enough so you don't have to ask about it.
you can make dictionary imput on every single word what will it be its meaning in numbers... we've done it in our faculty... the program ise easy to be made.
If you allow the user to use free form entry, you will find it is far beyond your current capabilities to write such a program. However, if you strictly limit what the user can enter, or better yet, only allow the user to select from a drop down list, the programming to do what you want is relatively trivial.
6 or more drop down boxes across the screen would be a really simple way, with titles like, Million, Hundred Thousand, Thousand, Hundred, Tenths, Units Or a harder way would be through a database, if you consider auto increment each id = a number. Populating the first one - one hundred would be the most tiresome, then php could do the rest. User input could be preg_match after a few checks, to display the corresponding id number.
Would this be any good ? Source: http://www.phpclasses.org/package/7082-PHP-Convert-a-string-of-English-words-to-numbers.html