get substring after character php
$data = "123_String";
$whatIWant = substr($data, strpos($data, "_") + 1);
echo $whatIWant;
4.5
10
<?php
$my_url = 'http://www.example.com/5478631';
echo substr($my_url, strrpos($my_url, '/' )+1)."\n";
?>
// print: 5478631
Thank you!
10
0
Are there any code examples left?
New code examples in category PHP