欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

报错Notice: Undefined offset: 1

程序员文章站 2022-05-29 11:22:24
...
		 $t)  {   $hk_warehouse[] = $hk_warehouse_fn;  }}$jp_warehouse=array();foreach(glob('download/jp_warehouse_mix*.txt') as $jp_warehouse_fa) {  if(substr($jp_warehouse_fa, 16, 8)>$t)  {   $jp_warehouse[] = $jp_warehouse_fa;  }}$mix_warehouse=array();foreach(glob('download/mix_warehouse_mix*.txt') as $mix_warehouse_fa) {  if(substr($mix_warehouse_fa, 17, 8)>$t)  {   $mix_warehouse[] = $mix_warehouse_fa;  }}$sum_warehouse=array();foreach(glob('download/sum_warehouse_mix*.txt') as $sum_warehouse_fa) {  if(substr($sum_warehouse_fa, 17, 8)>$t)  {   $sum_warehouse[] = $sum_warehouse_fa;  }}//warehouse_mix_label.pdf$hk_warehouse_pdf = array();foreach(glob('download/hk_warehouse_mix*.pdf') as $hk_warehouse_pdf_fn) {  if(substr($hk_warehouse_pdf_fn, 16, 8)>$t)  {   $hk_warehouse_pdf[] = $hk_warehouse_pdf_fn;  }}$jp_warehouse_pdf=array();foreach(glob('download/jp_warehouse_mix*.pdf') as $jp_warehouse_pdf_fa) {  if(substr($jp_warehouse_pdf_fa, 16, 8)>$t)  {   $jp_warehouse_pdf[] = $jp_warehouse_pdf_fa;  }}$mix_warehouse_pdf=array();foreach(glob('download/mix_warehouse_mix*.pdf') as $mix_warehouse_pdf_fa) {  if(substr($mix_warehouse_pdf_fa, 17, 8)>$t)  {   $mix_warehouse_pdf[] = $mix_warehouse_pdf_fa;  }}//pdf_mix $hk_pdf = array();foreach(glob('download/HK_print_Mix*.pdf') as $hk_pdf_fn) {  if(substr($hk_pdf_fn, 12, 8)>$t)  {   $hk_pdf[] = $hk_pdf_fn;  }}$jp_pdf=array();foreach(glob('download/JP_print_Mix*.pdf') as $jp_pdf_fa) {  if(substr($jp_pdf_fa, 12, 8)>$t)  {   $jp_pdf[] = $jp_pdf_fa;  }}$mix_pdf=array();foreach(glob('download/Mix_print_Mix*.pdf') as $mix_pdf_fa) {  if(substr($mix_pdf_fa, 13, 8)>$t)  {   $mix_pdf[] = $mix_pdf_fa;  }}//pdf_mix_A4$hk_pdf_a4 = array();foreach(glob('download/HK_print_Mix_A4_*.pdf') as $hk_pdf_a4_fn) {  if(substr($hk_pdf_a4_fn, 16, 8)>$t)  {   $hk_pdf_a4[] = $hk_pdf_a4_fn;  }}$jp_pdf_a4=array();foreach(glob('download/JP_print_Mix_A4_*.pdf') as $jp_pdf_a4_fa) {  if(substr($jp_pdf_a4_fa, 16, 8)>$t)  {   $jp_pdf_a4[] = $jp_pdf_a4_fa;  }}$mix_pdf_a4=array();foreach(glob('download/Mix_print_Mix_A4_*.pdf') as $mix_pdf_a4_fa) {  if(substr($mix_pdf_a4_fa, 17, 8)>$t)  {   $mix_pdf_a4[] = $mix_pdf_a4_fa;  }}//统计每类文件的数量,以便循环$hk_warehouse_count=count($hk_warehouse);$jp_warehouse_count=count($jp_warehouse);$mix_warehouse_count=count($mix_warehouse);$sum_warehouse_count=count($sum_warehouse);$hk_warehouse_pdf_count=count($hk_warehouse_pdf);$jp_warehouse_pdf_count=count($jp_warehouse_pdf);$mix_warehouse_pdf_count=count($mix_warehouse_pdf);$hk_pdf_count=count($hk_pdf);$jp_pdf_count=count($jp_pdf);$mix_pdf_count=count($mix_pdf);$hk_pdf_a4_count=count($hk_pdf_a4);$jp_pdf_a4_count=count($jp_pdf_a4);$mix_pdf_a4_count=count($mix_pdf_a4);$c=max($hk_warehouse_count,$jp_warehouse_count,$mix_warehouse_count,$sum_warehouse_count,$hk_warehouse_pdf_count,$jp_warehouse_pdf_count,$mix_warehouse_pdf_count,$hk_pdf_count,$jp_pdf_count,$mix_pdf_count,$hk_pdf_a4_count,$jp_pdf_a4_count,$mix_pdf_a4_count);echo $c;for($i=1;$i				       
		 	       	       	       	       	       	       	       	       	       	       	             


报以下错误:
Notice: Undefined offset: 1 in /var/www/html/amazon/download_all.php on line 203

请问哪时错了


回复讨论(解决方案)

你怎么知道
$hk_warehouse_count,$jp_warehouse_count,$mix_warehouse_count,$sum_warehouse_count,$hk_warehouse_pdf_count,$jp_warehouse_pdf_count,$mix_warehouse_pdf_count,$hk_pdf_count,$jp_pdf_count,$mix_pdf_count,$hk_pdf_a4_count,$jp_pdf_a4_count,$mix_pdf_a4_count
都大于 0 呢?

xuzuning大大,明白了,我加一个判断