Php “如何修复”;分析错误:语法错误,意外';:'&引用;?

Php “如何修复”;分析错误:语法错误,意外';:'&引用;?,php,Php,我在第190行没有看到任何错误:$query=”https://www.googleapis.com/youtube/v3/search?part=snippet&q=$search&maxResults=$per_page&videoCategoryId=$category&safesearch=strict&key=$apikey” <?php error_reporting(1); $movie = $_GET[movie]; $tmdb_api_k

我在第190行没有看到任何错误:
$query=”https://www.googleapis.com/youtube/v3/search?part=snippet&q=$search&maxResults=$per_page&videoCategoryId=$category&safesearch=strict&key=$apikey”

    <?php
    error_reporting(1);

    $movie = $_GET[movie];
    $tmdb_api_key = '9366d6385a1a15cab92bdde8de2b98af'; // change it with your themoviedb.com API
    $aff_link = 'http://google.com'; // your offer link

    $image_host = 'http://image.tmdb.org/t/p/';
    $json_tmdb  = 'http://api.themoviedb.org/3/movie/'.$movie.'?api_key='.$tmdb_api_key.'&append_to_response=credits,images,trailers,keywords,releases,similar_movies';

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $json_tmdb);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
    $response = curl_exec($ch);
    curl_close($ch);

    $data = json_decode($response);

    if ($data->title == null) {
        die;
    }

    $backdrop_to_background = $backdrop_to_player = 0;
    $backdrops = count($data->images->backdrops);

    if ($backdrops > 1) {
        $backdrop_to_player = rand(0, $backdrops-1);

        $backdrop_to_background = $backdrop_to_player;
        while ($backdrop_to_background == $backdrop_to_player) {
            $backdrop_to_background = rand(0, $backdrops-1);
        }
    }

    $movie_title      = $data->title;
    $movie_runtime    = $data->runtime;

    $n = count($data->genres);
    $i = 0;
    $movie_genres = '';
    while ($i <= $n-1) {
        $movie_genres .= $data->genres[$i]->name;
        if ($i < $n-1) {
            $movie_genres .= ', ';
        }
        $i++;
    }

    $n = count($data->credits->cast);
    $i = 0;
    $movie_cast = '';
    while ($i <= $n-1) {
        $movie_cast .= $data->credits->cast[$i]->name . ' (' . $data->credits->cast[$i]->character . ')';
        if ($i < $n-1) {
            $movie_cast .= ', ';
        }
        $i++;
    }

    $movie_plot       = $data->overview;
    $movie_poster     = $image_host.'w185'.$data->poster_path;
    $movie_player     = $image_host.'w780'.$data->images->backdrops[$backdrop_to_player]->file_path;
    $movie_background = $image_host.'w780'.$data->images->backdrops[$backdrop_to_background]->file_path;

?>

<html>
<head>
<title>Watch <?php echo $movie_title;?> Full Movie</title>
<link href="img/favicon.ico" rel="shortcut icon">
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Cabin" rel="stylesheet" type="text/css">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(
        function(){
            $("#player-play").click(
                function(){
                    $("#player-container").attr("style","background: url(img/stripes.png); background-repeat : repeat; z-index: 1; width: 854px; height: 480px; margin: 100px auto; position: absolute; top:0; left:0; bottom:0; right:0; z-index: 1; opacity: 0.9; filter:alpha(opacity=90); border: 20px solid rgba(255, 0, 0, 0.3);");
                    $("#player-play").addClass("player-hidden");
                    $("#player-error").removeClass("player-hidden")
                }
            )
        }
    )
</script>

<style>

body {
    margin : 0px 0px 0px 0px;
    background-color: #060606;
}

.player-play {
    width: 854px;
    height: 480px;
    background: url(img/inactive-button.png) no-repeat;
    background-size: cover;
    cursor: pointer;
    z-index: 2;
}

.player-play:hover {
    background : url(img/active-button.png) no-repeat;
}

.player-error {
    padding-top : 22%;
    max-width : 854px;
    margin : 0 auto;
    text-align : center;
    line-height : 5px;
    z-index : 2
}

.player-error p {
    color : #fff;
    font-size : 18px;
    margin : 20px auto;
}

.player-error a {
    color : #fff;
    font-size : 22px;
    text-decoration:underline;
}

.player-hidden {
    display:none!important;
    visibility:hidden!important;
}

.movie-title {
    font-family: 'Lobster', Georgia, Times, serif;
    font-size: 40px;
    line-height: 50px;
    color : #fff;
    text-align: center;
    margin-top: 15px;
}

.movie-plot {
    font-family: 'Cabin', Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 20px;
    color : #ffffff;
    width: 854px;
    margin : 570px auto;
    text-align: justify;
}



</style>

</head>

<body> 


<div class="movie-title">"<?php echo $movie_title; ?>" Full Movie</div>
<div style="background: url(<?php echo $movie_background;?>); background-attachment: fixed; background-repeat: no-repeat; background-size: cover; opacity: 0.3; filter:alpha(opacity=30); position:absolute; top:0; left:0; width:100%; height:100%;"></div>
<div style="background: url(<?php echo $movie_player;?>); background-repeat : no-repeat; background-size: cover; z-index: 1; width: 854px; height: 480px; margin: 100px auto auto; position: absolute; top:0; left:0; bottom:0; right:0; z-index: 1; border: 20px solid rgba(255, 0, 0, 0.3);" id="player-container">
    <div class="player-play" id="player-play"></div>
    <div class="player-error player-hidden" id="player-error">
        <img src="img/error.png" alt="error">
        <p>A plugin is needed to display this video.</p>
        <a href="<?=$aff_link;?>" target="_self">Install plugin...</a>
    </div>
</div>
<div class="movie-plot">
    <img src="<?php echo $movie_poster;?>" style="float: left; width: 120px; margin:0px 10px 10px 0px;">
    <p><b>Title : </b> <?php echo $movie_title; ?></p>
    <p><b>Genre : </b> <?php echo $movie_genres; ?></p>
    <p><b>Cast : </b> <?php echo $movie_cast; ?></p>
    <p><b>Movie Plot : </b><?php echo $movie_plot;?><br><br></p>
</div>

<?php

$apikey = “my api deleted for post”;
$per_page = 6;
$search = “lucy”;
$category = “2”; //autos

$query = “https://www.googleapis.com/youtube/v3/search?part=snippet&q=$search&maxResults=$per_page&videoCategoryId=$category&safesearch=strict&key=$apikey”;

$json_file3 = file_get_contents(“$query”);

$jfo3 = json_decode($json_file3,true);

foreach($jfo3[‘items’] as $val) {

$title = $val[‘snippet’][‘title’];
$description = $val[‘snippet’][‘description’];
$id = $val[‘id’][‘videoId’];
$thumbnail_url = $val[‘snippet’][‘thumbnails’][‘default’][‘url’];

echo <<<EOF

<p><img width = “250” src = “$thumbnail_url” align = “right”></a>
<a href =”video-viewer.php?v=$id”>$title<BR>
$description</p><br clear=”all”><HR>

EOF;

?>

</body>
</html>

看完整的电影
$(文件)。准备好了吗(
函数(){
$(“#玩家游戏”)。单击(
函数(){
$(“#播放器容器”).attr(“样式”,“背景:url(img/stripes.png)”;背景重复:重复;z索引:1;宽度:854px;高度:480px;边距:100px自动;位置:绝对;顶部:0;左侧:0;底部:0;右侧:0;z索引:1;不透明度:0.9;过滤器:alpha(不透明度=90);边框:20px实心rgba(255,0,0,0.3);”;
$(“#播放器播放”).addClass(“播放器隐藏”);
$(“#播放器错误”).removeClass(“播放器隐藏”)
}
)
}
)
身体{
保证金:0px 0px 0px 0px;
背景色:#0606;
}
.玩家游戏{
宽度:854px;
高度:480px;
背景:url(img/inactive button.png)不重复;
背景尺寸:封面;
光标:指针;
z指数:2;
}
.玩家游戏:悬停{
背景:url(img/active button.png)不重复;
}
.播放器错误{
垫面:22%;
最大宽度:854px;
保证金:0自动;
文本对齐:居中;
线高:5px;
z指数:2
}
.播放器错误p{
颜色:#fff;
字号:18px;
保证金:20px自动;
}
.播放器错误a{
颜色:#fff;
字体大小:22px;
文字装饰:下划线;
}
.隐藏的玩家{
显示:无!重要;
可见性:隐藏!重要;
}
.电影名称{
字体系列:“龙虾”,佐治亚州,泰晤士报,衬线;
字体大小:40px;
线高:50px;
颜色:#fff;
文本对齐:居中;
边缘顶部:15px;
}
.电影情节{
字体系列:“CAB”,Helvetica,Arial,无衬线;
字体大小:15px;
线高:20px;
颜色:#ffffff;
宽度:854px;
利润率:570px自动;
文本对齐:对齐;
}
“整部电影

这应该可以用

使用$json\u file3=file\u get\u contents($query);而不是$json_file3=file_get_contents(“$query”);。您只需键入一个使用addslashes()来转义字符,例如://将所有
字符替换为双引号
”。这应该可以修复语法错误。您使用的编辑器是什么?您可能已打开“自动更正”。
$query = "https://www.googleapis.com/youtube/v3/search?part=snippet&q=".$search."&maxResults=".$per_page."&videoCategoryId=".$category."&safesearch=strict&key=".$apikey;