I want a function to convert miles per hour to kilometers per hour within a phrase.
KPH may be found by dividing MPH by 0.621.
100 mph = 161 kph.
The challenge is finding the values within my text.
//////////////////////////
/
echo mi2km("Wind: South at 100 mph");
/// Wind: South at 161 kph
echo mi2km("Wind: N at 33 mph");
/// Wind: N at 53 mph
Start Free Trial