Extract numbers from string

Uses regular expression to extract numbers from given string. Read more.

php
fork add to bundle source
function extract_number($string) { preg_match('/(\d+)/', $string, $matches); return $matches ? $matches[1] : null; }

usage

load_function('extract_number'); $value = extract_number('Rating: 25'); echo $value; // 25
← how to use this in app?
create log ...inout