1
I have a little code that picks up the image, gives a name random
for it and saved in a folder. But now I need that in that same code generates the same image but with the size 100x100
and save in the same folder with the same name, only adding at the end "_small
". How can I do this?
<?php
error_reporting(E_ALL);
$file = file_get_contents("php://input");
$id = $_GET['photoId'];
if(strlen($file) < 50) {
die("2");
}
$imageName = substr(md5(time() . rand(1, 9999)), 0, 24);
file_put_contents("../photo/" . $imageName . ".png", $file);
echo $imageName;
?>