2017-05-01 56 views
-2
811.<div style="position:absolute; left:15.5%; top:108%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Profile/<?php echo $img_array[0] ?>" height="90" width="78"> </div> 
812.<div style="position:absolute; left:22%; top:108%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[1] ?>" height="90" width="78"> </div> 
813.<div style="position:absolute; left:28.5%; top:108%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[2] ?>" height="90" width="78"> </div> 
814.<div style="position:absolute; left:15.5%; top:125%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[3] ?>" height="90" width="78"> </div> 
815.<div style="position:absolute; left:22%; top:125%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[4] ?>" height="90" width="78"> </div> 
816.<div style="position:absolute; left:28.5%; top:125%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[5] ?>" height="90" width="78"> </div> 
817.<div style="position:absolute; left:15.5%; top:142%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[6] ?>" height="90" width="78"> </div> 
818.<div style="position:absolute; left:22%; top:142%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[7] ?>" height="90" width="78"> </div> 
819.<div style="position:absolute; left:28.5%; top:142%;"> <img src="../../fb_users/<?php echo $gender; ?>/<?php echo $user; ?>/Post/<?php echo $img_array[8] ?>" height="90" width="78"> </div> 

ERRORS:
通知(!):用C 3::未定義偏移\ wamp64 \ WWW \ peppal \ fb_files \ fb_profile \ Profile.php上線814調用堆棧#TimeMemoryFunctionLocation 10.0017384336 {主}()... \ Profile.php:0 「HEIGHT =」 90" 寬度= 「78」>注意:未定義偏移:3,4,5,6,7,8-

通知(!):未定義的偏移量:4行C:\ wamp64 \ www \ peppal \ fb_files \ fb_profile \ Profile.php在815行調用堆棧#TimeMemoryFunctionLocation 10.0017384336 {main}()... \ Profile.php:0「height =」90「width =「78」>

(! )注意:在816行的C:\ wamp64 \ www \ peppal \ fb_files \ fb_profile \ Profile.php中未定義偏移量:5調用堆棧#TimeMemoryFunctionLocation 10.0017384336 {main}()... \ Profile.php:0「height =」 (!)90" 寬度= 「78」>

注意:未定義偏移:6在C:\ wamp64 \ WWW \ peppal \ fb_files \ fb_profile \ Profile.php上線817調用堆棧#TimeMemoryFunctionLocation 10.0017384336 {主}()... \ Profile.php:0 「HEIGHT =」 90" 寬度= 「78」>

通知(!):用C 7::未定義偏移\ wamp64 \ WWW \ peppal \ fb_files #818行上的\ fb_profile \ Profile.php調用堆棧#TimeMemoryFunctionLocation 10.0017384336 {main}()... \ Profile.php:0「height =」90「width =」78「>

(! )注意:在819行的C:\ wamp64 \ www \ peppal \ fb_files \ fb_profile \ Profile.php中未定義偏移量:8調用堆棧#TimeMemoryFunctionLocation 10.0017384336 {main}()... \ Profile.php:0「height =」 90" 寬度=‘78’>

+0

而問題在哪裏? – tambre

回答

0

使用isset()檢查一個變量現有的或沒有,則代碼應該像,

print isset($img_array[3]) && '<div style="position:absolute; left:15.5%; top:125%;"> 
     <img src="../../fb_users/'.$gender.'/'.$user.'/Post/'.$img_array[3].'" 
     height="90" width="78"></div>'; 

其它數組索引使用相同的代碼。