不确定我做错了什么..
$url = "https://www.youtube.com/watch?v=5vXiaaIxPHs";
$contents = file_get_contents($url);
$contents = preg_replace("/\\r|\\n/", " ", trim($contents));
preg_match('#ytInitialData"\](\[\\s\\S\]\*?)window\["ytInitialPlayerResponse#', $contents, $matches);
var_dump($matches); //also tried print_r
preg match 找不到匹配项...... 有小费吗?坦克你这么多
上面试过 期待: 输出匹配