Change language

PHP Http_build_query () function

Syntax:
string http_build_query ($query_data, $numeric_prefix, $arg_separator, $enc_type = PHP_QUERY_RFC1738)
Parameters:This function takes four parameters as above and described below:
  • $query_data:This parameter contains an array or object containing properties below:
    • This can be a one-dimensional array or a multi-dimensional array.
    • If $query_data is an object, then only the public property will be included in the result.
    • $numeric_prefix:this parameter is used if numeric indices are used in the base array, it will be added to the numeric index only for elements in the base array.
    • $arg_separator:It is used to separate arguments, but can be overridden by specifying this parameter.
    • $enc_type:its default value - PHP_QUERY_RFC1738.
    Returned values:returns a URL encoded string.The following programs illustrate the http_build_query() function in PHP:Program 1: $info = array ( ’sudo’ = > ’placement’ , ’CPP’ = > ’ course’ , ’FORK’ = > ’C’ , ); echo http_build_query ( $info ). "#" ; echo http_build_query ( $info , ’’ , ’& amp;’ );  
    ?>
    Exit:
    sudo = placement & amp ; CPP = course & amp; FORK = C # sudo = placement & amp; CPP = course & amp; FORK = C
    Program 2: $info = array ( ’engineer’ , ’gfg’ = > ’ sudo’ , ’placement’ = > ’ hypertext processor ’ ); echo http_build_query ( $info ). "$" ; echo http_build_query ( $info , ’myvar_’ ); ?> Exit:
    0 = engineer & amp ; gfg = sudo & amp; placement = hypertext + processor $myvar_0 = engineer & amp; gfg = sudo & amp; placement = hypertext + processor
    Link:http://docs.php.net/manual/da/function.http-build-query.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method