<?php $arr = ["K" => 1 ,"M" => 2, "T" => 3]; $input = "12.2K"; if(isset($arr[strtoupper(substr($input, -1))])){ echo substr($input,0,-1) * pow(1000, $arr[strtoupper(substr($input, -1))]); }else{ echo $input; }
You have javascript disabled. You will not be able to edit any code.