http_build_query

Supported Versions: PHP 5, PHP 7, PHP 8
Generate URL-encoded query string
<?php http_build_query(    array|object $data,    string $numeric_prefix = "",    ?string $arg_separator = null,    int $encoding_type = PHP_QUERY_RFC1738): string
<?php                             'http' => array(

                                'method' => 'POST',

                                'header' => array('Content-type: application/x-www-form-urlencoded'),

                                'content' => http_build_query($params, '', '&'),

                                'timeout' => 3,

                            ),

                        );
<?php             'https://api.bitbucket.org/2.0/repositories/%s/%s?%s',

            $this->owner,

            $this->repository,

            http_build_query(

                array('fields' => '-project,-owner'),

                '',

                '&'

            )

        );



        $repoData = $this->fetchWithOAuthCredentials($resource, true)->decodeJson();
<?php             $resource = sprintf(

                '%s?%s',

                $this->tagsUrl,

                http_build_query(

                    array(

                        'pagelen' => 100,

                        'fields' => 'values.name,values.target.hash,next',

                        'sort' => '-target.date',

                    ),

                    '',

                    '&'

                )

            );

            $hasNext = true;

            while ($hasNext) {
<?php             $resource = sprintf(

                '%s?%s',

                $this->branchesUrl,

                http_build_query(

                    array(

                        'pagelen' => 100,

                        'fields' => 'values.name,values.target.hash,values.heads,next',

                        'sort' => '-target.date',

                    ),

                    '',

                    '&'

                )

            );

            $hasNext = true;

            while ($hasNext) {
<?php         $headers = array('Content-Type: application/x-www-form-urlencoded');



        $apiUrl = $originUrl;

        $data = http_build_query(array(

            'username' => $username,

            'password' => $password,

            'grant_type' => 'password',

        ), '', '&');

        $options = array(

            'retry-auth-failure' => false,

            'http' => array(