Mecha CMS

To::query()

Convert PHP array into URL query string.

2.0.0Static

To::query(array $in);

Example:

$A = To::query([
    'a' => 1,
    'b' => true,
    'c' => 'true',
    'd' => false,
    'e' => 'false',
    'f' => null,
    'g' => 'null',
    'h' => "",
    'i' => [
        'j' => [
            'k' => [1, 2],
            'l' => 'mno'
        ]
    ]
]);

Result:

$A = '?a=1&b&c=true&e=false&g=null&h=&i[j][k][0]=1&i[j][k][1]=2&i[j][l]=mno';