function stringConvert1($arra, $price) { stringConvert($arra); echo '<tr>'; foreach ($arra[0] as $booking) { $temp = $booking; $temp = explode(",", $temp); foreach ($temp as $key => $booking2) { if ($key == 0) { #checking } if ($key == 1 or $key == 2 or $key == 3) { echo "<td>" . $booking2 . "</td>"; } if ($key == 4) { echo "<td>"; echo '<img src="' . $booking2 . '" alt="images" >'; echo "</td>"; } if ($key == 5) { echo "<td>" . $booking2 . "</td>"; echo '<tr>'; echo '</tr>'; } if ($key == 2) { $price += $booking2; } } } }
$helperObj = new Helper("ecomm"); $pricedb; $userdb = $_SESSION['user']; $prodiddb; $tabledb = "buy_details"; $fielddb = "user_id,product_id,price"; $var = $_SESSION['user']; $obj = new Helper("ecomm"); $field = "user_id,mobile,address,city,zip"; $table = "user_details"; $condition = "user_id='" . $var . "'"; $record = $obj->read_record($field, $table, $condition); $arra = []; $price = 0; $arra = array(explode("&", str_replace('%2F', '/', str_replace('%2C', ',', urldecode(html_entity_decode($_SESSION['key'])))))); stringConvert($arra); // Its conversion of querystring data into Array Format foreach ($arra[0] as $booking) { $temp = $booking; $temp = explode(",", $temp); foreach ($temp as $key => $booking2) { if ($key == 0) { $prodiddb = substr($booking2, -7, 7); } if ($key == 2) { $price += $booking2; $pricedb = $booking2; } if ($key == 5) { $valuesdb = "'{$userdb}','{$prodiddb}','{$pricedb}'"; $result = $helperObj->insert($tabledb, $fielddb, $valuesdb);