I would like to have a php function that will strip any input and keep only a numeric ID, 36816268 in the example below.
The input can be something like this:
<iframe src="http://player.vimeo.com/video/36816268" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
or like this
<iframe src="http://player.vimeo.com/video/36816268" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><p><a href="http://vimeo.com/36816268">ABCinema</a> from <a href="http://vimeo.com/eeseitz">Evan Seitz</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
I can strip the first part as
preg_match('%.*http://player.vimeo.com/video/%im', $subject)
Since I can’t find a suitable duplicate to link (knowing similar questions have been asked many times), I’ll put it in as an answer. It is quite easy as long as the rest of the URL doesn’t need to change.