好的這裏是問題我有多個產品需要顯示一個註釋。如果沒有將每個產品的全部下面的代碼寫出來,最好的辦法是將筆記回顯給多個產品?在PHP中編寫多維數組的最佳方式是什麼?
<?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數組將是一個很好的開始:http://php.net/manual/en/language.types.array.php – DaveRandom