Skip to content

Instantly share code, notes, and snippets.

View josipjelic's full-sized avatar

Josip Jelić josipjelic

View GitHub Profile
@josipjelic
josipjelic / function-parse-video.php
Created October 29, 2015 22:37 — forked from AlexanderPoellmann/function-parse-video.php
A simple PHP function to parse a given string for a YouTube or Vimeo link (or embed code) and extract video ID, provider, etc.
<?php
/**
* Parse a video string
*
* @param string $haystack The string to be parsed
* @param string $protocol The protocol to be used for the urls
* @return array $video
*
* @version 2014-08-22
*