Created
June 13, 2015 16:56
-
-
Save NrI3/47b4da0f454968d59630 to your computer and use it in GitHub Desktop.
Envía varias imágenes en un objeto json en una sola peticion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('ImageToBase64.php'); | |
@$req = $_GET['req']; | |
switch ($req){ | |
case "test": | |
$r = array(); | |
$r['imgList']['imagen1']=imgGetData("./../image/0.png"); | |
$r['imgList']['imagen2']=imgGetData("./../image/0.jpg"); | |
$r['imgList']['imagen3']=imgGetData("./../image/0.gif"); | |
header('Content-Type: application/json'); | |
echo json_encode($r); | |
break; | |
case "background": | |
echo json_encode(imgGetData('./../image/background.jpg')); | |
break; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment