$no==1?json_encode($Home_Json[$no-1]['Title']):$Home_Jso"/> $no==1?json_encode($Home_Json[$no-1]['Title']):$Home_Jso">

Home  >  Article  >  Backend Development  >  未定义的偏移量1-Undefined offset: 1错误该怎样解决

未定义的偏移量1-Undefined offset: 1错误该怎样解决

WBOY
WBOYOriginal
2016-06-02 11:28:434752browse

未定义的偏移量1php

错误事件:E_NOTICE Run-time 通知。脚本发现可能有错误发生,但也可能在脚本正常运行时发生。
C:\WWW\weixin\member\shop\skin\23.php错误行数:第8行
错误原因:Undefined offset: 1

源代码:
$Dwidth = array('640','640','203','203','203','609','640','608','640','608');
$DHeight = array('320','63','121','121','121','93','63','187','63','187');
$Home_Json=json_decode($rsSkin['Home_Json'],true);
for($no=1;$no $json[$no-1]=array(
"ContentsType"=>$no==1?"1":"0",
"Title"=>$no==1?json_encode($Home_Json[$no-1]['Title']):$Home_Json[$no-1]['Title'],
"ImgPath"=>$no==1?json_encode($Home_Json[$no-1]['ImgPath']):$Home_Json[$no-1]['ImgPath'],
"Url"=>$no==1?json_encode($Home_Json[$no-1]['Url']):$Home_Json[$no-1]['Url'],
"Postion"=>$no>9 ? "t".$no : "t0".$no,
"Width"=>$Dwidth[$no-1],
"Height"=>$DHeight[$no-1],
"NeedLink"=>"1"
);
}

出现这个问题不知道咋解决。。。。求助各位

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn