fork(2) download
  1. <?php
  2.  
  3. // SET OUR DEFAULT URL
  4. $got_url_from_user_input = 'https://y...content-available-to-author-only...u.be/H-30B0cqh88';
  5. print "\nSTARTING URL: ".$got_url_from_user_input;
  6.  
  7. // DO THE REPLACE AND PRINT OUT THE FINAL RESULT
  8. $actual_URL = preg_replace('~https://youtu\.be/([-A-Z0-9]+)~i', 'https://y...content-available-to-author-only...e.com/embed/$1', $got_url_from_user_input);
  9. print "\nFINAL URL: ".$actual_URL;
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
STARTING URL: https://y...content-available-to-author-only...u.be/H-30B0cqh88
FINAL URL: https://y...content-available-to-author-only...e.com/embed/H-30B0cqh88