【发布时间】:2012-09-24 10:48:52
【问题描述】:
好的,我有多个产品需要显示备注。在不为每个产品写出以下整个代码的情况下,将注释与多个产品相呼应的最佳方法是什么?
<?php if ($data['header']['group_code'] == 'R088X') { ?>
<li><span>Printers:</span> Wipe the allocated print area before print application with methylated spirit.</li>
<?php } ?>
我试过下面的方法还是不行...
<?php
$data = array((['header']['group_code'] == 'R088X', 'R129X'));
if (in_array(['header']['category'] == 'R088X', $data)) { ?>
<li><span>Printers:</span> Wipe the allocated print area before print application with methylated spirit.</li>
<?php } ?>
任何建议将不胜感激:)
【问题讨论】:
-
学习 PHP 数组的基本语法将是一个好的开始:php.net/manual/en/language.types.array.php
标签: php multidimensional-array associative-array