<?php


$File = isset($_FILES['evrak_yolu']) ? $_FILES['evrak_yolu'] : null;

if ( $File == null ) {
    // Dosya yok.
    exit;
}

if ( $File['size'] < 1 ) {
    // Dosya boş.
    exit;
}

$FileNameExploded = explode('.', $File['name']);

if ( end($FileNameExploded) != 'pdf' ) {
    // Geçersiz pdf.
    exit;
}

$FileContent = file_get_contents($File['tmp_name']);

if(!preg_match("/^%PDF-/", $FileContent)){
    //Geçersiz pdf.
    exit;
}