I have a variable with value formats like:
$var = "10 some text, numbers";
$var = "1 some text, numbers";
$var = "99232 some numbers, text";
$var = "182 some text, numbers";
(Basically a number a space and anything)
I want to extract the first number from the variable and assign it to another variable So If I extracted "10 some text, numbers" I would be left with:
$newvar = "10";
What is the matching characters that can do this? I greatly appreciate any help.
$var = "10 some text, numbers";
$var = "1 some text, numbers";
$var = "99232 some numbers, text";
$var = "182 some text, numbers";
(Basically a number a space and anything)
I want to extract the first number from the variable and assign it to another variable So If I extracted "10 some text, numbers" I would be left with:
$newvar = "10";
What is the matching characters that can do this? I greatly appreciate any help.