Here's how I'd do it using a regex.
<?php
$string = '0 This is one Sentence
1 some more information
2 username 11
3 username 33
4 Maybe some Anime?
5 Another Anime?
6 Please no more Anime.';
echo preg_replace('~^\d+\s+~m', '', $string);
Output:
This is one Sentence
some more information
username 11
username 33
Maybe some Anime?
Another Anime?
Please no more Anime.
~
is a delimiter it tells the regex where the expression starts and ends.
The ^
is the start of each line because of the m
modifier. The \d+
is one or more numbers. The \s+
is one or more white space characters. The +
is a quantifier meaning one or more of the preceding character, if you wanted 0 or more you would use *
.