-1

我有简单的变量

$body = array(
        'content' => 'content test',
        'is_sanitize' => true,
        'sanitize_replacement' => '***',
        'meta' => array(
                    'name' => 'another',
                    'email' => 'another@email.com'
                )
    );

当我使用build_http_query($body)时,它给了我

content=content%20test&is_sanitize=1&meta=another&meta=another%40email.com&sanitize_replacement=%2A%2A%2A

问题是“名称”和“电子邮件”键在哪里?为什么 build_http_query 不添加那些键?

谢谢

4

1 回答 1

2

结果应该是

content=content+test&is_sanitize=1&sanitize_replacement=%2A%2A%2A&meta%5Bname%5D=another&meta%5Bemail%5D=another%40email.com

注意:不是build_http_query,而是http_build_query

于 2012-12-17T04:14:31.563 回答