fork(7) download
  1. <?php
  2. $str = "Save 20% on iPhone chargers...";
  3. if (preg_match_all('/\d+(?=%)/', $str, $match))
  4. print_r($match[0]);
  5. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 20
)