8000 [HttpFoundation] Small fixes on some examples by nicoweb · Pull Request #10247 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] Small fixes on some examples #10247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions components/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
0