Demo: Convertir nuestros registros MySQL a JSON con PHP

Actualizado: 28-10-2021 / 3:01 AM
{
    "postres": [
        {
            "id": "1",
            "nombre": "Torta de Chocolate",
            "stock": "35",
            "precio": "5.00",
            "url": "torta-de-chocolate",
            "img": "tc.jpg",
            "fecha": "2018-08-11 21:25:28"
        },
        {
            "id": "2",
            "nombre": "Pie de Manzana",
            "stock": "45",
            "precio": "4.50",
            "url": "pie-de-manzana",
            "img": "pm.jpg",
            "fecha": "2018-08-11 21:25:33"
        },
        {
            "id": "3",
            "nombre": "Arroz con Leche",
            "stock": "36",
            "precio": "2.50",
            "url": "arroz-con-leche",
            "img": "al.jpg",
            "fecha": "2018-08-11 21:25:36"
        },
        {
            "id": "4",
            "nombre": "Gelatina de Fresa",
            "stock": "60",
            "precio": "1.50",
            "url": "gelatina-de-fresa",
            "img": "gf.jpg",
            "fecha": "2018-08-11 21:25:39"
        },
        {
            "id": "5",
            "nombre": "Suspiro a la Limeña",
            "stock": "26",
            "precio": "6.00",
            "url": "suspiro-a-la-lime\u00f1a",
            "img": "sl.jpg",
            "fecha": "2018-08-11 21:25:42"
        },
        {
            "id": "6",
            "nombre": "Mazamorra Morada",
            "stock": "50",
            "precio": "3.00",
            "url": "mazamorra-morada",
            "img": "mm.png",
            "fecha": "2018-08-11 21:25:45"
        }
    ]
}

En Nube Colectiva hablamos sobre:

Frontend

Backend

Android

Otros