PHP: File exists and is in a certain sub-directory

Posted by Svish on Stack Overflow See other posts from Stack Overflow or by Svish
Published on 2010-06-11T15:34:06Z Indexed on 2010/06/11 15:43 UTC
Read the original article Hit count: 194

Filed under:
|
|
|

I get a file path to a user file and I want to make sure that this path is to a valid existing user file and not to something bogus or a system file or something like that.

I know I can use file_exists to check that it exists, but I'm not sure how I should make sure that the file is in a certain sub-directory...

© Stack Overflow or respective owner

Related posts about php

Related posts about validation