Skip to content

Instantly share code, notes, and snippets.

View mmaldonadoemergya's full-sized avatar

Maikel Maldonado del Toro mmaldonadoemergya

View GitHub Profile
@mmaldonadoemergya
mmaldonadoemergya / youtube_id_regex.php
Created June 18, 2021 13:02 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@mmaldonadoemergya
mmaldonadoemergya / AddMoreRemoveForm.php
Created July 16, 2020 03:31 — forked from swappyp20/AddMoreRemoveForm.php
Add remove form elements with tabledrag and ajax drupal 8.x
<?php
namespace Drupal\experiments\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Utility\SortArray;
/**
* Class AddMoreForm.