Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $path = "Some.Stuff.Articles.is_visible";
- $arr = explode('.', $path);
- $partCount = count($arr);
- if ($partCount-1 > 1)
- $out = $arr[$partCount - 2] . '.' . $arr[$partCount - 1];
- else if ($partCount-1 === 1)
- $out = $arr[$partCount - 1];
- else
- $out = $arr[0];
- echo $out;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement