note 126186 added to function.file-exists

From: Date: Wed, 23 Jun 2021 06:06:08 +0000
Subject: note 126186 added to function.file-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-216538@lists.php.net to get a copy of this message
NB: This function expects the full server-related pathname to work. For example, if you run a PHP routine from within, for example, the root folder of your website and and ask: $bstr = file_exists("/images/Proofreading_patients.jpg"); You will get FALSE even if that file does exist off root. You need to add $bstr = file_exists(__DIR_."/images/Proofreading_patients.jpg"); to get it to return TRUE - ie : /srv/www/mywebsite.com/public/images/Proofreading_patients.jpg ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.85.242 (proxied: 91.231.60.21) ---- Manual Page -- https://php.net/manual/en/function.file-exists.php Edit -- https://main.php.net/note/edit/126186 Del: integrated -- https://main.php.net/note/delete/126186/integrated Del: useless -- https://main.php.net/note/delete/126186/useless Del: bad code -- https://main.php.net/note/delete/126186/bad+code Del: spam -- https://main.php.net/note/delete/126186/spam Del: non-english -- https://main.php.net/note/delete/126186/non-english Del: in docs -- https://main.php.net/note/delete/126186/in+docs Del: other reasons-- https://main.php.net/note/delete/126186 Reject -- https://main.php.net/note/reject/126186 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#216538) next »