You can use array_filter()to filter an array, returning only elements that match the specified condition:
$picturethumbs = array_filter($picture, function($v) {
return stristr($v, '_thumb');
});
, _thumb. , _thumb -, (, my_thumb.gif )
$picturethumbs = array_filter($picture, function($v) {
return substr($v, -10) === '_thumb.jpg';
});
, 10 _thumb.jpg.
( ):
array
0 => string 'artist2-1_thumb.jpg' (length=19)
2 => string 'artist2-3_thumb.jpg' (length=19)
4 => string 'artist2-5_thumb.jpg' (length=19)