I have:
$string = "Some minimal or large text 820 some minimal or large descr";
I need:
some minimal or large descr
I have:
$string = "Some minimal or large text 820 some minimal or large descr";
I need:
some minimal or large descr
What about str_pos()?
<?php
$string = "Some minimal or large text 820 some minimal or large descr";
echo substr($string, strpos($string, '820') + 4);
The function preg_split can do for you!
It splits the string into an array transforming it ..
http://www.php.net/manual/en/function.preg-split.php
$array = preg_split("/[0-9]+/", "Some minimal or large text 820 some minimal or large descr");
print_r($array);
To isolate some minimal or large descr
which comes after the space that follows 820
, match all non-digital characters from the start of the string until one or more digits, then zero or more spaces. Replace these matched characters with an empty string.
Code: (Demo)
$string = "Some minimal or large text 820 some minimal or large descr";
var_export(
preg_replace('/\D*\d+ */', '', $string)
);
If multiple numbers may occur and you want the substring after the last occurring number, then greedily match any character before matching a number. (Demo)
var_export(
preg_replace('/.*\d+ */', '', $string)
);