igor-kachko/otus-composer-package

此包最新版本(1.0.4)没有可用的许可证信息。

1.0.4 2024-09-13 15:39 UTC

This package is not auto-updated.

Last update: 2024-09-27 15:45:28 UTC


README

  • getLength(string $str) - 获取字符串长度
  • checkParenthesis(string $str) - 检查字符串中开闭括号是否正确

安装

composer require igor-kachko/otus-composer-package

使用

<?php  
  
$processor = new StringProcessor();  
echo $processor->getLength('my string'); // 9

try {
    $processor->checkParenthesis("(1+2))(text())))()()()");
    echo "Все хорошо";
} catch(\Exception $e) (
    echo $e->getMessage();
)