Skip to content

Instantly share code, notes, and snippets.

@fabioluciano
Created February 2, 2012 03:40
Show Gist options
  • Save fabioluciano/1721276 to your computer and use it in GitHub Desktop.
Save fabioluciano/1721276 to your computer and use it in GitHub Desktop.
<?php require_once 'DataUri.php'; ?>
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="UTF-8" />
<title>base64</title></title>
<script type='text/javascript' src='js.js'></script>
<link rel="stylesheet" href="css.css" type="text/css" media="screen" />
</head>
<body>
<div class="image-list">
<?php
$dir = './imgs/';
$iterator = new DirectoryIterator($dir);
foreach ($iterator as $fileinfo) {
if ($fileinfo->isFile()) {
$uri = new DataUri($dir. $fileinfo->getFileName());
echo '<img src="' . $uri->generate() . '" />' . PHP_EOL;
}
}
?>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment