直接用
echo $type;就可以了在参数名加个$,组成这个变量就可以了

解决方案 »

  1.   

    只有这种方法可以$_GET['type']
    获得的参数是什么类型的?
      

  2.   

    php对类型检查不是很严格type.php
    <a href="type_get.php?type=1">test</a>type_get.php
    <?php
    $localtype=2;
    $typex=$_GET['type'];
    echo "$typex is the type:".gettype($typex)."<br>";
    echo "$localtype is the type:".gettype($localtype)."<br>";
    if(is_int("$type")){
    echo 'int';
    }
    else{
    echo "request arg is not int"."<br>";
    }
    if($typex==$localtype){
    echo "equals";
    }
    ?>
      

  3.   

    $type=$_GET['type']
    可以用(int)$type (string)$type强制转换