Created by chauhansudhir@gmail.com
* This is an example to demonstatrate how we can embed binary in XML. Here an array of images path
* given to generateBinaryXML method and XML document saved in the given path. savePath should be a
* physical path because images are large in size and results large XML document.
create output folder and implement the following code
require('BinaryXML.php');
$binaryXML = new BinaryXML();
$savePath = 'test.xml';
$images = Array('1.jpg', '2.jpg', '3.jpg', '4.jpg');
$result = $binaryXML->generateBinaryXML($images, $savePath, true, '1.0');
if ($result) {
print 'XML generated';
}
else {
print 'XML not generated';
}
# parse XML and saves images to output folder
$binaryXML->parseXML($savePath, 'output/'); |