$img_base64 = substr($res['photo'],strrpos($res['photo'],','));$img_decode = base64_decode($img_base64);$namess = time().rand(10000,99999);$cc= file_put_contents('img/avatar/'.$namess.'.png',$img_decode);$urls=DS . 'img' . DS . 'avatar/' .$namess.'.png';