Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

Latest commit

 

History

History
10 lines (7 loc) · 303 Bytes

How to do substring in reverse in PHP.md

File metadata and controls

10 lines (7 loc) · 303 Bytes

We have a string like this /international/europe/uefa-champions-league/20182019/final/r48409

And we want to get this substring r48409

This is the PHP code to achieve that.

$b = '/international/europe/uefa-champions-league/20182019/final/r48409';
echo substr($b, strrpos($b, '/') + 1);