How can I change the format that a date is displayed:
To show the dates of a table, they are shown as follows:
- 2016-06-28
- 2016-06-29
- 2016-07-01
- 2016-07-03
And I wanted to change that sample format for one like this:
- 2016, 06, 28
- 2016, 06, 29
- 2016, 07, 01
- 2016, 07, 03
This is the code with which I am showing my dates:
<?php
include 'conexion.php';
$sql = "SELECT * FROM venta";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo $row["fecha_emision"]."<br>";
}
} else {
echo "0 results";
}
$conn->close();
?>
Any way to do it?