1. Go to this page and download the library: Download bvp/trimmer 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/ */
$objectA = new class {
private string $propertyA = ' trimmerA ';
private string $propertyB = ' trimmerB '; // This will not be trimmed.
public function getPropertyA(): string { return $this->propertyA; }
public function setPropertyA(string $value): void { $this->propertyA = $value; }
public function getPropertyB(): string { return $this->propertyB; }
};
Trimmer::trim($objectA);
// $propertyA will be trimmed, $propertyB will remain unchanged.
$objectB = new class($objectA) {
private string $propertyC = ' trimmerC ';
private string $propertyD = ' trimmerD '; // This will not be trimmed.
private object $objectA;
public function __construct(object $objectA) {
$this->objectA = $objectA;
}
public function getPropertyC(): string { return $this->propertyC; }
public function setPropertyC(string $value): void { $this->propertyC = $value; }
public function getPropertyD(): string { return $this->propertyD; }
public function getObjectA(): object { return $this->objectA; }
};
Trimmer::trim($objectB);
// $propertyC and $objectA->propertyA will be trimmed, $propertyD and $objectA->$propertyB will remain unchanged.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.