Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 嵌入:未定义的索引html_Php_Html_Embed - Fatal编程技术网

Php 嵌入:未定义的索引html

Php 嵌入:未定义的索引html,php,html,embed,Php,Html,Embed,如果您熟悉嵌入文章的方式,If会为您提供一个很好的缩略图,单击该缩略图时,会在灯箱中打开正在嵌入的材料的预览。但是,当我单击嵌入文章()的缩略图时,我会看到注意:未定义的索引:C:\wamp\www\articleddisplay.php中的html,位于第131行 第131行是case'video':的print$oembed['html'],如下所示 我猜一篇文章可能不应该以视频的形式嵌入,而且我显然遗漏了Embeddely的一些代码 以前与Embedly合作过的人能帮我解决这个问题吗?多谢

如果您熟悉嵌入文章的方式,If会为您提供一个很好的缩略图,单击该缩略图时,会在灯箱中打开正在嵌入的材料的预览。但是,当我单击嵌入文章()的缩略图时,我会看到
注意:未定义的索引:C:\wamp\www\articleddisplay.php中的html,位于第131行

第131行是
case'video':
print$oembed['html']
,如下所示

我猜一篇文章可能不应该以视频的形式嵌入,而且我显然遗漏了Embeddely的一些代码

以前与Embedly合作过的人能帮我解决这个问题吗?多谢各位

switch($oembed['type']) {
        case 'photo':
            print '<div class="embed-content"><div class="embed-wrapper">';
            if (!array_key_exists('title', $oembed)) {
              ?><img src="<?php echo $oembed['url'] ?>"></img><?php
            }
            else {
                ?><img src="<?php echo $oembed['url'] ?>" alt="<?php echo $oembed['title'] ?>"></img><?php
            }
            print '</div></div>';
            break;
        case 'link':
        case 'rich':
        case 'video':
            print '<div class="embed-content"><div class="embed-wrapper">';
            print $oembed['html'];
            print '</div></div>';
            break;
        case 'error':
        default:
        }
开关($oembed['type'])){
案件‘照片’:
打印“”;
如果(!array_key_存在('title',$oembed)){
?>“>”alt=“”>您应该从switch语句中删除“link”的大小写,oEmbed只包含“rich”和“video”的html。“link”类型并不总是包含html,它会响应您的示例链接

switch($oembed['type']) {
    case 'photo':
        print '<div class="embed-content"><div class="embed-wrapper">';
        if (!array_key_exists('title', $oembed)) {
          ?><img src="<?php echo $oembed['url'] ?>"></img><?php
        }
        else {
            ?><img src="<?php echo $oembed['url'] ?>" alt="<?php echo $oembed['title'] ?>"></img><?php
        }
        print '</div></div>';
        break;
    case 'rich':
    case 'video':
        print '<div class="embed-content"><div class="embed-wrapper">';
        print $oembed['html'];
        print '</div></div>';
        break;
    case 'error':
    default:
开关($oembed['type'])){
案件‘照片’:
打印“”;
如果(!array_key_存在('title',$oembed)){

?>“>”alt=“”>你应该登上天空帆船“时间之剑”,驾驶它飞到那边的蔚蓝荒野中,身后有一千大群的多斯拉克人骑着它。

这只修复了一半……点击缩略图现在什么都没做(但至少没有出错?)