使用php的Foreach循环

时间:2013-06-20 06:22:04

标签: php loops foreach

我在打印出存储在$description内的数组时遇到问题。

这是我的代码:

<?php foreach($descriptions as $description) { foreach ($languages as $language) { ?>
 <div class="tabs-add language_id_<?php echo $language['language_id']; ?>" id="tab-language-<?php echo $module_row; ?>-<?php echo $language['language_id']; ?>">
    <table id="general" class="form">
     <tr>
        <td><?php echo $entry_title; ?></td>
        <td><input type="text" name="announcement_module[<?php echo $module_row; ?>][title][<?php echo $language['language_id']; ?>]" id="title-<?php echo $module_row; ?>-<?php echo $language['language_id']; ?>" value="<?php echo isset($module['title'][$language['language_id']]) ? $module['title'][$language['language_id']] : ''; ?>" /></td>
      </tr>

      <tr>
        <td><?php echo $entry_description; ?> &nbsp;&nbsp;<a onclick="removeMessage(this);"><?php echo $button_remove; ?></a></td>
        <td><textarea name="announcement_module[<?php echo $module_row; ?>][description][<?php echo $description_row;?>][<?php echo $language['language_id']; ?>]" id="description-<?php echo $module_row; ?>-<?php echo $description_row;?>-<?php echo $language['language_id']; ?>"><?php echo isset($module['description'][$description_row][$language['language_id']]) ? $module['description'][$description_row][$language['language_id']] : ''; ?></textarea></td>
      </tr>
   </table>
  </div>    

我想打印出$entry_description用户想要的次数。但我似乎无法一次打印多个。我该如何解决这个问题?

0 个答案:

没有答案