I have a database with a column containing a variety of numbers written in \"shorthand\", for example:
5k for 5,000
86.6k for 86,600
4.1m for 4,100,000
1
Logic to implement, iterate through all the characters, and when you find a character (not digit) just save the index. Now split that into two parts: digital value and character. Now create a function which returns the value of passed character. eg. getValueOf('M')=1000000 And then finally do this Numerical Value * getValueOf('M') That's all. Note: Your numerical values have commas in it so also do str_replace(',','',numeric value) and then convert to int