Log 2589

// Sample input data
$products = array(“Product 1”, “Product 2”, “Product 3”);
$quantities = array(10, 20, 30);

// Initialize an empty string to store the result
$result = “”;

// Loop through each product and quantity
for ($i = 0; $i < count($products); $i++) {
// Get the current product and quantity
$product = $products[$i];
$quantity = $quantities[$i];

// Concatenate the product name with its quantity separated by a colon (:)
$result .= "{$product}:{$quantity} ";
}

// Echo the final result
return trim($result);

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
  • Attributes
  • Custom attributes
  • Custom fields
Click outside to hide the comparison bar
Compare