- Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
- Parse error: syntax error, unexpected 'http' (T_STRING) in /in/cKc3E on line 4
Process exited with code 255.
<?php
$video = "https://youtu.be/9g30pPikveg";
$pattern = 'https?://(?:www\.)?youtu\.be/\';
$replacement = 'http://www.youtube.com/embed/';
$final = preg_replace($pattern, $replacement, $video);
echo $final;