본문 바로가기

PHP/PHP함수

file_exists

<?php

header("Content-Type: text/html; charset=UTF-8");

$file = "p11.jpg";


if(file_exists($file)){

    echo "파일 존재";

    $fp = fopen($file,"r");

    if($fp == null){

        echo "파일없음";

    }else{

        echo "파일염";

        echo "<img src='/sample/upload/p1.jpg'  />";

        fclose($fp);

    }

}else{

    echo "파일 존재안함";

}

?>













http://www.everdevel.com/PHP/file-function.php

'PHP > PHP함수' 카테고리의 다른 글

is_resource()  (0) 2017.11.17
fopen, fclose  (0) 2017.11.17
array_key_exists / in_array  (0) 2017.11.17
array_search()  (0) 2017.11.17
array_pop  (0) 2017.11.17