iam looking for a way to assign the first result of a preg_match lookup in a variable.
Something like that:
$foo = 'MwSt. DE 19%'; $var = preg_match("/[0-9]*/",$foo)
I would not like to handle an new variable with a new array to get my result of 19.
I know, i can do it so:
$bla = 'MwSt. DE 19%'; preg_match("/[0-9]+/",$bla,$zahl); var_dump($zahl);
But you see my problem here, i need a new variable $zahl. Is there no smarter way to get the result, one like my first idea ( $var = preg_match(“/[0-9]*/”,$foo) )?