1. Go to this page and download the library: Download tourze/text-manage-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Tourze\TextManageBundle\Service\TextFormatter;
class MyService
{
public function __construct(
private readonly TextFormatter $textFormatter
) {
}
public function process(): string
{
// 基本文本处理
return $this->textFormatter->formatText('Hello World');
}
}