Skip to content

Instantly share code, notes, and snippets.

@NrI3
Created June 13, 2015 16:56
Show Gist options
  • Save NrI3/47b4da0f454968d59630 to your computer and use it in GitHub Desktop.
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
<?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