I´m just trying to figure out the way, how can I scale/resize the resolution of an image in PHP. I´m working on an online form where user can upload their picture, then I want to reduce the initial resolution to 300x300px and use move_uploaded_file() function to pass that image to a certain folder. Just to clarify, you can imagine it like this "scale" function bellow.
$user_pic = scale($_FILES['form_image']['tmp_name']); // Scale
$dir = 'assets/img/folder/new_pic.jpg'; // Upload
move_uploaded_file($user_pic, $dir);