PHPackages                             bvp/trimmer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bvp/trimmer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bvp/trimmer
===========

Trimmer for Boatrace Venture Project

6.0.0(4mo ago)078.8k↑30.2%6MITPHPPHP ^8.2CI passing

Since Aug 15Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/shimomo/bvp-trimmer)[ Packagist](https://packagist.org/packages/bvp/trimmer)[ RSS](/packages/bvp-trimmer/feed)WikiDiscussions 6.x Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (6)Used By (6)

Trimmer for Boatrace Venture Project
====================================

[](#trimmer-for-boatrace-venture-project)

[English](README.md) | [日本語](README_ja.md)

[![keepalive](https://github.com/shimomo/bvp-trimmer/actions/workflows/keepalive.yml/badge.svg)](https://github.com/shimomo/bvp-trimmer/actions/workflows/keepalive.yml)[![psalm](https://github.com/shimomo/bvp-trimmer/actions/workflows/psalm.yml/badge.svg)](https://github.com/shimomo/bvp-trimmer/actions/workflows/psalm.yml)[![security](https://github.com/shimomo/bvp-trimmer/actions/workflows/security.yml/badge.svg)](https://github.com/shimomo/bvp-trimmer/actions/workflows/security.yml)[![test](https://github.com/shimomo/bvp-trimmer/actions/workflows/test.yml/badge.svg)](https://github.com/shimomo/bvp-trimmer/actions/workflows/test.yml)[![codecov](https://camo.githubusercontent.com/1973bf24d6b2e2cee85f3957b3ee1724e7bc74f74210f3335131e108ad84cad5/68747470733a2f2f636f6465636f762e696f2f67682f7368696d6f6d6f2f6276702d7472696d6d65722f67726170682f62616467652e7376673f746f6b656e3d32374539334430314d4e)](https://codecov.io/gh/shimomo/bvp-trimmer)[![php](https://camo.githubusercontent.com/75108c5e4583d1b185ecda50819a7edac79a53561968e48dcafed49cdcf6765a/68747470733a2f2f706f7365722e707567782e6f72672f6276702f7472696d6d65722f726571756972652f706870)](https://packagist.org/packages/bvp/trimmer)[![stable](https://camo.githubusercontent.com/3be8064dbec2f755855b9a144f4267f6e8255ef386ca0290eb11c6631dc0b0c0/68747470733a2f2f706f7365722e707567782e6f72672f6276702f7472696d6d65722f762f737461626c65)](https://packagist.org/packages/bvp/trimmer)[![license](https://camo.githubusercontent.com/de75e1a03179c382dc205ddcfeb924052a6424f2f1bfd117a522b698895683ee/68747470733a2f2f706f7365722e707567782e6f72672f6276702f7472696d6d65722f6c6963656e7365)](https://packagist.org/packages/bvp/trimmer)

Trimmer is a PHP library that extends the built-in functions `trim`, `ltrim`, and `rtrim` and allows you to recursively trim **arrays** and **objects** as well.

📦 Requirements
--------------

[](#-requirements)

- PHP: ^8.2
- myclabs/deep-copy: ^1.11

💾 Installation
--------------

[](#-installation)

```
composer require bvp/trimmer
```

⚡ Usage
-------

[](#-usage)

### Supported Methods

[](#supported-methods)

MethodDescriptionParameters`Trimmer::trim(`
 `$value,`
 `$characters = null`
 `$encoding = null`
`)`Trims strings, arrays, and objects`$value` : string | array | object
`$characters` : Characters to remove (optional)
`$encoding` : Character encoding (optional, e.g., 'UTF-8')`Trimmer::ltrim(`
 `$value,`
 `$characters = null`
 `$encoding = null`
`)`Left-side trimmingSame as above`Trimmer::rtrim(`
 `$value,`
 `$characters = null`
 `$encoding = null`
`)`Right-side trimmingSame as above### Basic Usage

[](#basic-usage)

```
