有没有办法将一个get变量添加到php include中

时间:2011-05-10 18:35:56

标签: php

我正在尝试这样做......是否可能

<?php include("includes/sidebar.php?show_hide_tab=true"); ?>

因为有些页面在侧栏中不需要一些逻辑

1 个答案:

答案 0 :(得分:6)

就这样做

<?php
    $show_hide_tab = true;

    include('includes/sidebar.php');
?>

$show_hide_tab变量的范围将落入包含脚本。

相关问题