Is::file()
Checks if current input is a valid file path.
Table of Contents
Description
Is::file(mixed $value): bool;This method checks that the input provided is a valid file path. This method validates the file path and ensures that the file exists. This method is a safer alternative to the native is_file() function as it can accept any type of input to check. For best performance, of course I would still recommend you to just use the native is_file() function. However, this is only effective if you have ensured that the input to be tested is a string.
Example
if (Is::file('.\path\to\file.txt')) {
// …
}Is::IP()
Checks for valid IP address.
Is::JSON()
Checks for valid JSON string.
Is::URL()
Checks for valid URL address.
Is::_()
Creates a virtual method.
Is::__callStatic()
Calls the virtual method that has been created.
Is::email()
Checks for valid email address.
Is::file()
Checks if current input is a valid file path.
Is::folder()
Checks if current input is a valid folder path.
Is::path()
Checks if current input is a valid path.
Is::serial()
Checks for valid serialized string.
Is::toggle()
Checks for valid boolean.
Is::void()
Checks for empty string, array and object.