PHP 7.2 is the latest stable release of PHP. May of popular yum repositories are providing rpm packages for PHP 7. This article is using Remi and EPEL yum repositories for installing required packages on your system. This article will help you to install PHP 7.2, PHP 7.1 on CentOS & Red Hat 7.4 & 6.9 servers. This tutorial has been tested with CentOS 7.4.Install PHP7, Nginx and MySQL on CentOS/R..
$fp = fopen($_FILES["thumbnail"]["tmp_name"], "r");$image_stream = fread($fp, 64);if ( preg_match( '/^\x89PNG\x0d\x0a\x1a\x0a/', $image_stream) ) { $type = "png";} elseif ( preg_match( '/^GIF8[79]a/', $image_stream) ) { $type = "gif";} elseif ( preg_match( '/^\xff\xd8/', $image_stream) ) { $type = "jpg";}fclose($fp);