Created
August 15, 2013 00:05
-
-
Save Pestov/6237060 to your computer and use it in GitHub Desktop.
Convert image to URI
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
<form method="post" action="#" enctype="multipart/form-data"><input type="file" name="file"/> <input type="submit" value="Кодировать в URI"/></form> | |
<?php | |
if(isset($_FILES['file'])){ | |
echo "<textarea rows='1' cols='1' style='margin:10px;width:100%;height:800px;border:2px solid #333'>url(data:{$_FILES['file']['type']};base64, | |
" . base64_encode(file_get_contents($_FILES['file']['tmp_name'])) . ')</textarea>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment