PHP code example of kennisnet / youtubeurlnormalizer

1. Go to this page and download the library: Download kennisnet/youtubeurlnormalizer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kennisnet / youtubeurlnormalizer example snippets



$yt = new YoutubeUrlNormalizer("http://www.youtube.com/watch?v=7cZFk68S3js&time_continue=12&list=PLi_srCikhtghrNa6Ti1d4aSyPQzQ3JI63&index=4");

var_dump($yt->isYoutube);
# bool(true)

echo $yt->normalized;
# https://youtu.be/7cZFk68S3js

echo $yt->normalized_parameters;
# https://youtu.be/7cZFk68S3js?index=4&list=PLi_srCikhtghrNa6Ti1d4aSyPQzQ3JI63&time_continue=12