Grab remaining text after last “/” in a php string

前端 未结 8 2022
我寻月下人不归
我寻月下人不归 2020-12-28 11:47

So, lets say I have a $somestring thats holds the value \"main/physician/physician_view\".

I want to grab just \"physician_view\". I want it to also wo

8条回答
  •  难免孤独
    2020-12-28 12:29

    For another one liner, you can use the explode trick and reverse the array:

    current(array_reverse(explode('/',$url)));
    

提交回复
热议问题