validate file exist php

35

Input : echo file_exists('/user01/work/gfg.txt');
Output : 1

Input : $file_pointer = '/user01/work/gfg.txt';
        if (file_exists($file_pointer)) {
            echo "The file $file_pointer exists";
        }else {
            echo "The file $file_pointer does 
                                   not exists";
        }
Output : 1

Comments

Submit
0 Comments