How to Install PHP 7.2, 7.1 on CentOS/RHEL 7.4 & 6.9
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..
PHP
2018. 4. 17. 18:57
png, gif, jpg 이미지 확인 방법
$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);
PHP
2016. 4. 21. 10:54