I have a string which returns data usage in B, KB, MB and so on. I want to separate the number and string part of it.
Ex : 14.5 MB - I want 14.5 and MB separately.
I tried using regex
'/(\d+)(\w)/'
but does not give the desired result.
Expected result
Array( [0] => 14.5, [1] => 'MB' )