我有这个网址:
uploads/offers/picture/_YToxOntzOjc6Im9wdGlvbnMiO3M6MTY6Inpvb21Dcm9wLDI4MS_/_wyMDAiO30=_/518edc82d94b0-201341717250_descuen_a06d000000fkvwpiak_1_1.jpg
我需要得到所有/_(.*)_/
部分,但我的preg_match_all
表情似乎很糟糕:
preg_match_all('#/_([^_/]+)_/#', $url, $params);
退货
Array
(
[0] => Array
(
[0] => /_YToxOntzOjc6Im9wdGlvbnMiO3M6MTY6Inpvb21Dcm9wLDI4MS_/
)
[1] => Array
(
[0] => YToxOntzOjc6Im9wdGlvbnMiO3M6MTY6Inpvb21Dcm9wLDI4MS
)
)
我需要
Array
(
[0] => Array
(
[0] => /_YToxOntzOjc6Im9wdGlvbnMiO3M6MTY6Inpvb21Dcm9wLDI4MS_/
[1] => /_wyMDAiO30=_/
)
[1] => Array
(
[0] => YToxOntzOjc6Im9wdGlvbnMiO3M6MTY6Inpvb21Dcm9wLDI4MS
[1] => wyMDAiO30=
)
)
表达式中常见的字符串部分有问题吗?