DiegoP. DiegoP. - 2 months ago 7
PHP Question

How do I get whatever is after the underscore?

I have this string:

21839547737_10150750480732738


In PHP,how do I get whatever is after the underscore
_
?

Answer

You should use the substr function and the strpos function

$string = "21212121312312_11231231231323213";
$afterunderscore = substr($string, strpos($string, "_") + 1);

This will give you the information after the underscore