DataRater Posted November 25, 2009 Share Posted November 25, 2009 PHP 5 Please help. What function/code snippet can I call/use to do the following I get the following string from google '1 British pound = 1.6642 U.S. dollars' I want to get the 1.6642. Note this can be from any currency to any other currency. Stephen :-) Link to comment https://forums.phpfreaks.com/topic/182896-parsing-googles-currency-conversion/ Share on other sites More sharing options...
cags Posted November 25, 2009 Share Posted November 25, 2009 How about... $input = '1 British pound = 1.6642 U.S. dollars'; preg_match("#= \K[0-9.]+#", $input, $out); echo $out[0]; Link to comment https://forums.phpfreaks.com/topic/182896-parsing-googles-currency-conversion/#findComment-965354 Share on other sites More sharing options...
DataRater Posted November 25, 2009 Author Share Posted November 25, 2009 Excellent!! Many Thanks, Stephen Link to comment https://forums.phpfreaks.com/topic/182896-parsing-googles-currency-conversion/#findComment-965369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.