tokenize() 공개 정적인 메소드

Options - clean: true/false (defaults to true and removes empty tokens and whitespace)
public static tokenize ( string $data, string $separator = ',', array $options = [] ) : array
$data string The data to tokenize
$separator string The token to split the data on.
$options array
리턴 array
예제 #1
0
 public function testTokenize()
 {
     $res = Utility::tokenize('');
     $this->assertSame([], $res);
     $res = Utility::tokenize('some');
     $this->assertSame(['some'], $res);
     $res = Utility::tokenize('some, thing');
     $this->assertSame(['some', 'thing'], $res);
     $res = Utility::tokenize(',some,,, ,, thing,');
     $this->assertSame(['some', 'thing'], array_values($res));
 }