示例#1
0
 public static function fromString($value)
 {
     if (false === ($index = strpos($value, ';'))) {
         return new static($value);
     }
     return new static(substr($value, 0, $index), Directives::parseDirectives(substr($value, $index + 1)));
 }
示例#2
0
 public static function fromString($value)
 {
     $index = strpos($value, '=');
     $name = substr($value, 0, $index);
     $index2 = strpos($value, ';', $index + 1);
     if ($index2 === false) {
         return new static($name);
     }
     $val = substr($value, $index + 1, $index2 - $index - 1);
     return new static($name, Uri::decode($val), Directives::parseDirectives(substr($value, $index2 + 1)));
 }