Re: Feature Request

From: Date: Wed, 04 Jan 2012 16:27:41 +0000
Subject: Re: Feature Request
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-57186@lists.php.net to get a copy of this message
realpath function do this for you. It returns the absolute path, if file exists. Otherwise, returns null. On Wed, Jan 4, 2012 at 2:18 PM, Keloran <ava3ar@gmail.com> wrote: > I dont seem to have the karma for doing this in RFC so ill propose it here, > and once karma make an RFC > > Is it possible to have a 2nd option on file_exists so that it returns the > path you specified > > --Example > $cFile = file_exists("/file/located/here.php", true); > > and if that exists it will return > /file/located/here.php > > instead of true > > --Reason > the reason for this is simple actually at the moment if you want to include > a file for usage but want to check it exists you have todo the following > if (file_exists("/file/located/here.php")) { >  $cFile = "/file/located/here.php"; > } > > which can if your doing lots of checking alot of extra code for no reason, > or if you want to use variables, lots of louse variables just for something > that could be pulled from the request -- Atenciosamente, Rafael Kassner

« previous php.internals (#57186) next »