diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 2a6c9da2dd8..a9c8927021c 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -262,23 +262,23 @@ this complexity and defines some methods for the most common tasks:: use Symfony\Component\HttpFoundation\HeaderUtils; // Splits an HTTP header by one or more separators - HeaderUtils::split('da, en-gb;q=0.8', ',;') - // => array(array('da'), array('en-gb'), array('q', '0.8')) + HeaderUtils::split('da, en-gb;q=0.8', ',;'); + // => array(array('da'), array('en-gb','q=0.8')) // Combines an array of arrays into one associative array - HeaderUtils::combine(array(array('foo', 'abc'), array('bar'))) + HeaderUtils::combine(array(array('foo', 'abc'), array('bar'))); // => array('foo' => 'abc', 'bar' => true) // Joins an associative array into a string for use in an HTTP header - HeaderUtils::toString(array('foo' => 'abc', 'bar' => true, 'baz' => 'a b c'), ',') + HeaderUtils::toString(array('foo' => 'abc', 'bar' => true, 'baz' => 'a b c'), ','); // => 'foo=abc, bar, baz="a b c"' // Encodes a string as a quoted string, if necessary - HeaderUtils::quote('foo "bar"') - // => 'foo \"bar\"' + HeaderUtils::quote('foo "bar"'); + // => '"foo \"bar\""' // Decodes a quoted string - HeaderUtils::unquote('foo \"bar\"') + HeaderUtils::unquote('"foo \"bar\""'); // => 'foo "bar"' Accessing ``Accept-*`` Headers Data