gpt4 book ai didi

php - PHP公告: Undefined index: in a line

转载 作者:行者123 更新时间:2023-12-03 08:15:25 25 4
gpt4 key购买 nike

我知道很多人都问过这个问题,但我的工作不兼容:

if(isset($instance['threadnumbers'] == "")){ $instance['threadnumbers'] == "" }

它显示以下调试错误:

PHP Notice: Undefined index: threadnumbers in /home/content/59/12158859/html/development/wp-content/plugins/dpt/disqus-ptw.php on line 27



该区域如下:
if ($instance['threadnumbers'] == NULL) {
$instance['threadnumbers'] = "5";
}

如何解决?非常感谢 :)

最佳答案

您有剪切和粘贴错误。您正在尝试使用比较运算符分配值。 ==应该是=

您还在作业上使用isset()

if(isset($instance['threadnumbers'])){ $instance['threadnumbers'] == "" }

应该
if(!isset($instance['threadnumbers']) || empty($instance['threadnumbers'])) { 
$instance['threadnumbers'] = "";
}

关于php - PHP公告: Undefined index: in a line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25630932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com