php基本语法

1.php的字符串的变量连接
function create($filename,$index)
{
        $fp=fopen($filename,'w+');
        if ($fp){
        fputs($fp, "DEVICE=eth$index\n");
        fclose($fp);
        }
}
错误的写法:
function create($filename,$index)
{
        $fp=fopen($filename,'w+');
        if ($fp){
        fputs($fp, "DEVICE=eth."$index"\n");
        fclose($fp);
        }
}
尝试使用.连接传递的变量。


2 php判断语句
 if($_POST['TYPE'] == "Bounding")

错误写法: 

 if($_POST['TYPE'] = "Bounding")


你可能感兴趣的:(字符串,function,create)