fork download
  1. <?php
  2.  
  3. $string = 'Mountain guesthouse (23.40m) in Radons';
  4.  
  5. preg_match('#([0-9\.]+)m#is', $string, $matches);
  6.  
  7. $peak = $matches[1];
  8.  
  9. echo $peak . 'm'; # 2.340m
  10.  
  11. ?>
  12.  
  13.  
Success #stdin #stdout 0.01s 13112KB
stdin
Standard input is empty
stdout
23.40m