/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<html> <head> <title>Ascii</title> <style> body{ line-height:1px; font-size:1px; } </style> </head> <body> <?php function getext($filename) { return $str; } $image = 'image.jpg'; $ext = getext($image); if($ext == ".jpg"){ } else{ echo'Wrong File Type'; } for($h=0;$h<$height;$h++){ for($w=0;$w<=$width;$w++){ $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; if($w == $width){ echo '<br>'; }else{ echo '<span style="color:rgb('.$r.','.$g.','.$b.');">X</span>'; } } } // file_output_contents("test.html"); echo $output; ?>