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