Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php中将变量添加到数组中_Php - Fatal编程技术网

在php中将变量添加到数组中

在php中将变量添加到数组中,php,Php,我想在此代码中添加当前url,但出现错误: 没有当前URL的工作代码: <?php echo sqr_qrcode( vcard, array( 'n' => get_field('name'), 'org' => get_field('company'), 'url' => get_field('url'), 'tel' =&

我想在此代码中添加当前url,但出现错误:

没有当前URL的工作代码:


    <?php
    echo sqr_qrcode(
        vcard,
        array(
            'n' => get_field('name'),
            'org' => get_field('company'),
            'url' => get_field('url'),
            'tel' => get_field('phone'),
            'note' => get_field('current_url'),
            'email' => get_field('email')
        ),
        3,
        false,
        array(
            'fill' => '#000000',
            'size' => '600',
            'background' => '#ffffff'
        )
    );



似乎您在条件中有一个错误放置的结束括号

$link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ?  "https" : "http" . "://" . $_SERVER['HTTP_HOST']. $_SERVER['REQUEST_URI'];

我想我得到服务器406的问题,因为使用不安全的代码梅比在可湿性粉剂

我是这样做的,让它工作

global $wp;

$current_url =  home_url( $wp->request );
global $wp;

$current_url =  home_url( $wp->request );