kamrandotpk / vowel-counter
一个Composer包,用于计算给定文件或字符串中元音字母的数量
dev-main
2023-04-04 19:12 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: 10.0.19
This package is not auto-updated.
Last update: 2024-10-03 00:20:27 UTC
README
此包允许您计算文件或字符串中的元音字母数量。
安装
composer require kamrandotpk/vowel-counter
示例用法
<?php require_once 'vendor/autoload.php'; $vowelCounter = new \VowelCounter\VowelCounter(); $text = "There are 11 vowels in this sentence."; // count vowels in a file $file = new \SplTempFileObject(); $file->fwrite($text); echo $vowelCounter->countVowelsInFile($file); // outputs 11 // counts vowels in a string echo $vowelCounter->countVowelsInAString($text); // outputs 11
请参阅包含的单元测试以获取更多示例用法。
Composer包URL: https://packagist.org.cn/packages/kamrandotpk/vowel-counter