Hello! I need to use the $ name variable in the code, how to get it out of the function? And how to write in an external file? Thank.
function LoadFoto($foto){ $type = $foto['type']; $name = $foto['name']; $uploaddir = "avatars/"; $name = md5(microtime()).".".substr($type, strlen("image/")); if(move_uploaded_file($foto['tmp_name'], $uploaddir.$name)) { return true; } else return false; }