Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['article-add'])) {
- $imageinfo = getimagesize($_FILES['article-image']['tmp_name']);
- $arr = array('image/jpeg','image/gif','image/png');
- if (array_search($imageinfo['mime'],$arr)) {
- echo "Такой формат есть";
- echo array_search($imageinfo['mime'],$arr);
- }
- else {
- echo "Такого формата нет";
- echo array_search($imageinfo['mime'],$arr);
- }
- }
- <form enctype="multipart/form-data" action="index.php" method="post">
- <label for="article-image">Картинка статьи:</label><br>
- <input type="file" id="article-image" name="article-image">
- <button name="article-add" type="submit">Отправить</button>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement