<?php$str = "Save 20% on iPhone chargers...";if (preg_match_all('/\d+(?=%)/', $str, $match)) print_r($match[0]);?>
Standard input is empty
Array ( [0] => 20 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!