-3
我有這樣一段代碼,它工作正常,但我的一個客戶所得到的致命錯誤:無法使用字符串作爲上線陣列偏移151
Fatal error: Cannot use string offset as an array
我評論說,產生錯誤的行。
<?php
$thumbId1 = get_field('portfolio_images'); //this is the line that generates the error
$portfolio_large = $thumbId1[0]['image'];
$mafioso_smvideo = get_field('small_video',$post->ID);
if($mafioso_smvideo!='') {
echo do_shortcode($mafioso_smvideo);
}
elseif (!$portfolio_large == ''){
?>
<?php
echo '<img src="'.aq_resize($portfolio_large, 340, 197, true).'" alt="'.get_the_title().'" class="categ-thumb"/>';
?>
請張貼get_field功能。 – cguedel
這是一個重複問題:http://stackoverflow.com/questions/3059927/fatal-error-cannot-use-string-offset-as-an-array –