2017-05-01 62 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>'; 

其它数组索引使用相同的代码。