这很疯狂,希望有人能解释一下。
$dir = getcwd();
$a = "/var/www/vhosts/mysite/httpdocs/sub1";
$b = "/var/www/vhosts/mysite/httpdocs/sub2";
if( ($dir == $a) || ($dir == $b) ){
$dirlist = glob("../images2/spinner/*.jpg");
}else{
$dirlist = glob("images2/spinner/*.jpg");
}
工作正常,但
$dir = getcwd();
if( ($dir == "/var/www/vhosts/mysite/httpdocs/sub1") || ($dir == "/var/www/vhosts/mysite/httpdocs/sub2") ){
$dirlist = glob("../images2/spinner/*.jpg");
}else{
$dirlist = glob("images2/spinner/*.jpg");
}
没有。(不起作用我的意思是它返回错误,我也试过 === )
任何人?