Tags 警告:字符串偏移量“tag”非法

Tags 警告:字符串偏移量“tag”非法,tags,warnings,Tags,Warnings,我在下面得到这个警告,有什么帮助吗 <label class="inputLabel"<?php echo ($field['tag']) ? ' for="'.$field['field']['tag'].'"': ''; ?>><?php echo $field['title']; ?></label> **strong text** 下面是代码的一部分 <div class="discountForm<?php ech

我在下面得到这个警告,有什么帮助吗

<label class="inputLabel"<?php echo ($field['tag']) ? ' for="'.$field['field']['tag'].'"': ''; ?>><?php echo $field['title']; ?></label>      **strong text**
下面是代码的一部分

<div class="discountForm<?php echo $selectionStyle; ?> discount<?php echo $box; ?>">
<fieldset class="discount">
  <legend><?php echo $selection[$i]['module']; ?></legend>
  <?php echo $selection[$i]['redeem_instructions']; ?>
  <div class="gvBal larger"><?php echo $selection[$i]['checkbox']; ?></div>
  <div class="gvBal">
  <?php foreach ($selection[$i]['fields'] as $field) { ?>
    <label class="inputLabel"<?php echo ($field['tag']) ? ' for="'.$field['field']['tag'].'"': ''; ?>><?php echo $field['title']; ?></label>      
    <?php echo $field['field']; ?> 
  <?php } ?>
  <?php   if ( ($selection[$i]['module'] != MODULE_ORDER_TOTAL_INSURANCE_TITLE) && ($selection[$i]['module'] != MODULE_ORDER_TOTAL_SC_TITLE) ) { ?>
    <div class="buttonRow"><?php echo zen_image(zen_output_string($template->get_template_dir(BUTTON_IMAGE_UPDATE, DIR_WS_TEMPLATE, $current_page_base, 'buttons/' . $_SESSION['language'] . '/') . BUTTON_IMAGE_UPDATE), BUTTON_UPDATE_ALT, '', '', 'onclick="updateForm();"'); ?></div>
  <?php   } ?>
  </div> 
</fieldset>
您正试图使用字符串索引访问字符串


您将$field视为一个数组,而它实际上是一个字符串。检查您的代码和$selection[$i]['fields']输出是什么。

$field变量是如何组成的?请提供代码。请查看我的更新帖子。在我从5.3升级到PHP5.6后,这个警告开始出现,两个版本之间发生了一些事情。