我无法从会话数组中删除特定记录。当我单击删除链接时,我想删除表中的特定行。
<?php
session_start();
if(isset($_GET["product"]) && isset($_GET["category"])){
$nomProduct = trim($_GET["product"]);
$category = trim($_GET["category"]);
$_SESSION['product'][] = array(
"nomProduct" => $nomProduct ,
"category" => $category
);
//session_destroy();
}
?>
html table
<table class="table">
<?php foreach($_SESSION["product"] as $items) { ?>
<tr>
<th width="250px"><?php echo $items['nomProduct']; ?></th>
<td><?php echo $items['category']; ?></td>
<td style="text-align: right"><a href="">Delete</a><td>
</tr>
<?php }?>
</table>
四季花海
开心每一天1111