$a = '<img src="/resource/public/game/2015/4/17/360aae11-78fc-4d91-b016-0995918039a4.gif" width="90" height="90"> <img src="/resource/public/game/1414944000/599afd66-8740-47b6-b935-68d427fa5821.jpg" width="90" height="90">'; $b = '/\b\/.+(?=" width\b)/'; preg_match_all($b, $a, $c); var_dump($c); array(1) { [0]=> array(2) { [0]=> string(72) "/resource/public/game/2015/4/17/360aae11-78fc-4d91-b016-0995918039a4.gif" [1]=> string(52) "/1414944000/599afd66-8740-47b6-b935-68d427fa5821.jpg" } }
I want to match the picture name, how should I match it?
360aae11-78fc-4d91-b016-0995918039a4.gif
599afd66-8740-47b6-b935-68d427fa5821.jpg
The idea is from the back Match forward to the first/end but I don’t know how to write
Someone has already answered, let me make a suggestion. I suggest you use the explode() function to convert it into an array, and then use array_pop() to get the picture name
I can’t even understand this
this