小编And*_*rew的帖子

in_array()不起作用

我的代码:

<?php

$pass = "12345";

//checkPass($pass, $user, $length);
$file = file_get_contents("common.txt");
$array = explode("\n", $file);
if(in_array($pass, $array) == true) {
 echo "it's in the array";
}
?>
Run Code Online (Sandbox Code Playgroud)

数组的前几行(我使用print_r($ array)...):

Array ( [0] => 12345 [1] => abc123 [2] => password [3] => computer [4] => 123456 
[5] => tigger [6] => 1234 [7] => a1b2c3 [8] => qwerty [9] => 123 [10] => xxx 
[11] => money [12] => test [13] => carmen [14] => mickey [15] => secret 
[16] …

html php

5
推荐指数
1
解决办法
1万
查看次数

CSS文件未在子目录中链接

这是我的目录结构:

-根

--docs

--- doc1.php

--includes

---的header.php

--- footer.php

--- css.css

--index.php

在我的标题中,我链接到我的CSS文件,如下所示:

<link href="includes/styling.css" type="text/css" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)

这适用于index.php,因为它是正确的路径(root/includes/css.css).

但是对于doc1.php来说,这不是正确的道路.(根/文档/包括/ css.css).

如何在保留一个包含该行代码的header.php文件的同时修复此问题?有没有办法强制路径在根目录中启动?

html css

2
推荐指数
2
解决办法
1万
查看次数

标签 统计

html ×2

css ×1

php ×1