我不知道如何说出问题。我不是PHP的专家。我正在尝试编辑一个热点插件。我有这样的代码仅回显阵列外部的阵列的一部分
function ult_hotspot_items_callback($atts, $content = null){
global $hotspot_icon, $hotspot_icon_bg_color, $hotspot_icon_color, $hotspot_icon_size;
extract(shortcode_atts(array(
'hotspot_content' => '',
'hotspot_label' => '',
'hotspot_position' => '0,0',
'tooltip_content' => '',
'tooltip_width' => '300',
'tooltip_padding' => '',
'tooltip_position' => '',
"icon_type" => '',
'icon' => 'Defaults-map-marker',
'icon_color' => '',
'icon_style' => '',
'icon_color_bg' => '',
'icon_border_style' => '',
'icon_color_border' => '',
'icon_border_size' => '',
'icon_border_radius' => '',
'icon_border_spacing' => '',
'icon_img' => '',
'img_width' => '60',
'link_style' => '',
'icon_link' => '',
'icon_size' => '',
"alignment" => "center",
'tooltip_trigger' => '',
'tooltip_animation' => '',
'tooltip_continuous_animation' => '',
'glow_color' => '',
'enable_bubble_arrow' => 'on',
'tooltip_custom_bg_color' => '#fff',
'tooltip_custom_color' => '#4c4c4c',
'tooltip_font' => '',
'tooltip_font_style' => '',
'tooltip_font_size' => '',
'tooltip_font_line_height' => '',
'tooltip_custom_border_size' => '',
'tooltip_align' => '',
), $atts) );
我想REFFERENCE /电话/呼应只是“‘tooltip_content’”该数组的数组在页面上其他地方之外的结果。我该如何去做呢?
谢谢。
不幸的是,有字符数限制我想分享所有的页面代码,但它不会让我
它是imp可以用你提供的东西回答这个问题。正如它表明数组只在函数内部定义的,并且不能在其外部访问。 – trincot
好吧然后我可以创建另一个变量引用该数组或复制它,只是从tooltip_content获取信息? – user3438298
我不太明白你想要什么,因为你包含的PHP代码有一个硬编码的'tooltip_content'值,即空白。只有它是动态的,它才有用。注意:你不需要共享你的所有代码,只需要分享必要的部分。例如,我们不需要知道该数组的其他30个键/值。 – trincot