隐藏数组中的文件并显示其他内容

时间:2016-08-05 10:46:12

标签: php arrays apache .htaccess

删除文件后我有删除功能,它将打印所有已删除的文件,如下所示

  

数组(

     

[0] => [文件]:C:\ xampp \ htdocs \ public_html \ cjl \ jquery-sandbox \ zuuttt \ default.php

     

[1] => [文件]:C:\ xampp \ htdocs \ public_html \ cjl \ jquery-sandbox \ zuuttt.htaccess

     

[2] => [目录]:C:\ xampp \ htdocs \ public_html \ cjl \ jquery-sandbox \ zuuttt

     

[3] => [文件]:C:\ xampp \ htdocs \ public_html \ cjl \ jquery-sandbox \ zuuttt \ page.html

     

主目录是 jquery-sandbox

已删除的子目录及其文件内容为 zuuttt

现在我的问题是我在zuuttt内有两个文件,我不希望它显示它已删除数组列表我希望它隐藏我累了这样做但它仍然显示文件

<?php
//The delete is working fine and below here is from my class
$result = $rmjails->remove($deletethis);

//This is what i tried to hide it with
if(is_array($result)){
$hide = array('.htaccess','default.php');
$filtered_array = array_filter($result, function ($element) use ($hide) { return ($element != $hide); } );
print_r($filtered_array);
}

//==============
//This is default one i was using

if(is_array($result)){
print_r($result);
}
?>

如何隐藏这两个文件.htaccessdefault.php

另外两个问题

我昨天的问题直到现在都没有答案,我需要一个关于那个的帮助

Having multiple htaccess in a root directory

如何打印已删除的文件和目录而不将其显示在数组Array ([0] => [File]: C:\xampp\htdocs\public_html\cjl\jquery-sandbox\zuuttt\default.php)中,以便它看起来像[File]: C:\xampp\htdocs\public_html\cjl\jquery-sandbox\zuuttt\default.php

谢谢

0 个答案:

没有答案