The following is the code I'm using in order to convert the GIF file into a PNG file and save it into a variable:
$art = $_FILES["art"]["name"];
$art_ext = pathinfo($art, PATHINFO_EXTENSION);
if(strtoupper($art_ext)=="GIF"){
$art = imagepng(imagecreatefromstring(file_get_contents($_FILES["art"]["tmp_name"])), $art."png");
}
if($art!=""){
move_uploaded_file($art, "images/".$art );
}
Also, is there a method for converting an animated gif to a static gif?