custom() 공개 정적인 메소드

Formats a string by a custom callable.
public static custom ( string $value, callable | array $format ) : string
$value string Value
$format callable | array A callable or an array of a callable and additional params
리턴 string
예제 #1
0
 public function testCustom()
 {
     $value = 77;
     $format = 'octdec';
     $this->assertEquals(63, rex_formatter::custom($value, $format));
     $format = [function ($params) {
         return $params['subject'] . ' ' . $params['some'];
     }, ['some' => 'more params']];
     $this->assertEquals('77 more params', rex_formatter::custom($value, $format));
 }