|
Size: | 9812 |
Storage flags: | no_autoload,compress/gzip (30%) |
Zend\Validator\File\WordCount checks for the number of words within a file.
The following set of options are supported:
min (integer) default: null
The number of words allowed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | // Limit the amount of words to a maximum of 2000
$validator = new \Zend\Validator\File\WordCount(2000);
// Limit the amount of words to between 100 and 5000
$validator = new \Zend\Validator\File\WordCount(100, 5000);
// ... or with array notation
$validator = new \Zend\Validator\File\WordCount(array(
'min' => 1000, 'max' => 5000
));
// Perform validation with file path
if ($validator->isValid('./myfile.txt')) {
// file is valid
}
|
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.