how can I print multiple services in this way

You insert services/prices as another array. So use this and it will be ok: I want to print both result in php In file A $_SESSION[‘cart’][‘prices’][] = ‘1000’; $_SESSION[‘cart’][‘services’][] = ‘game’; In File B $_SESSION[‘cart’][‘prices’][] = ‘2000’; $_SESSION[‘cart’][‘services’][] = ‘game2’; In file C foreach ($_SESSION[‘cart’][‘services’] as $key => $service) { echo $service . ‘ = … Read more

Array value is replaced when second one stores in php

About First part mistakes : <?php if(isset($_POST[‘radio’])){ $_SESSION[‘sz’]=$_POST[‘radio’]; $si=$_SESSION[‘sz’]; } <a href=”https://stackoverflow.com/questions/32310282/product_detail.php?pdt_id=”.$pdid.’&add=’ .$pdid .’&size=”.$si.”” class=”cartBtn” onclick=”return fun1()”>Add to cart</a>’; ?> Your a tag is completely wrong as @Hearner said. It should be out of the php tag or inside with an “echo” like this : echo “<a href=”https://stackoverflow.com/questions/32310282/product_detail.php?pdt_id=”.$pdid.”&add=”.$pdid.”&size=”.$si.”” class=”cartBtn” onclick=’return fun1()’>Add to cart</a>”; You cannot … Read more