我想从我的 URL 中返回这些唯一值
394_black
500_mono2
网址:
/shop/swarovski/394_black_the-reagan-swarovski-maxi-dress
/shop/celeb/500_mono2_the-reagan-swarovski-maxi-dress
我可以在 PHP 中执行此操作吗?
伪代码
$url = get url
$firstvar = after 3rd / and after second _ save text (500_mono2) from $url
$secondvar = using $firstvar return only first 3 numbers
//substr($firstvar, 0, 3); (I think this will be it)