我想用爆显示输入,如:破灭输入字段
我的代码:
$qty = array('2', '2', '1');
$price = array('200', '400', '1000');
$subtotal = array('400', '800', '1000');
echo "<li>
Quantity: <input type='text' class='qty' name='qty' value='".implode("'>
Quantity: <input type='text' class='qty' name='qty' value='",$qty)."'>
Price: <input type='text' class='price' name='price' value='".implode("'>
Price: <input type='text' class='price' name='price' value='",$price)."'>
Subtotal: <input type='text' class='subtot' name='subtot' value='".implode("'>
Subtotal: <input type='text' class='subtot' name='subtot' value='",$subtotal)."'>
</li>";
我的代码已经给出的结果:
编辑:
我想我的代码应该是这样的格式:
<li>
Quantity: <input ..>
Price: <input ..>
Subtotal: <input ..>
<li>
<li>
Quantity: <input ..>
Price: <input ..>
Subtotal: <input ..>
<li>
<li>
Quantity: <input ..>
Price: <input ..>
Subtotal: <input ..>
<li>
...
请检查http://php.net/manual/en/function.implode.php。你的数组在哪里是imploade函数? –
@DineshPatra代码已更新。 –
如果你想显示然后爆炸数组,然后将它们的值给你的回声。 –