startsWith() public static method

public static startsWith ( $string, $start )
Exemplo n.º 1
0
 public function testStartsWith()
 {
     self::assertTrue(StringType::startsWith('foo', 'f'));
     self::assertTrue(StringType::startsWith('foo', 'foo'));
     self::assertFalse(StringType::startsWith('foo', 'oo'));
     self::assertFalse(StringType::startsWith('f', 'foo'));
 }
Exemplo n.º 2
0
 /**
  * Find all headers matching the specified name.
  *
  * @param string $name Header name.
  *
  * @return array Headers.
  */
 public function findHeaders($name)
 {
     return array_filter($this->getHeaders(), function ($header) use($name) {
         return StringType::startsWith($header, "{$name}:");
     });
 }