How to get everything after a certain character in a string?

How to get everything after a certain character in a string?

Asked on December 31, 2020 in info.
Add Comment
1 Answer(s)
$string = 'filename.jpg';
$extension = strrchr( $string, '.'); //returns ".jpg"
Answered on December 31, 2020.

$data = “123_String”;
$whatIWant = substr($data, strpos($data, “_”) + 1);
echo $whatIWant;

on December 31, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.