[英]PHP Delete returns an error
Whenever I try to delete the counter.txt
using PHP, I always get an error: 每当我尝试使用PHP删除
counter.txt
,我总是会收到错误:
Fatal error: Call to undefined function delete() in C:\\XAMPP\\htdocs\\jellykat\\control-panel.php on line 12
致命错误:在第12行的C:\\ XAMPP \\ htdocs \\ jellykat \\ control-panel.php中调用未定义的函数delete()
Here is my code: 这是我的代码:
<?php delete("counter.txt"); ?>
What's wrong with it? 它出什么问题了? Can you suggest me ways on the other methods that I can delete the
counter.txt
? 你能否告诉我其他方法的方法,我可以删除
counter.txt
?
Don't blame me. 不要怪我。 I got the
delete()
method from here: http://www.w3schools.com/php/func_filesystem_delete.asp 我从这里得到了
delete()
方法: http : //www.w3schools.com/php/func_filesystem_delete.asp
You should use unlink()
instead .. there is no such delete()
你应该使用
unlink()
代替..没有这样的delete()
If you see the manual of delete()
, It says.. 如果你看到
delete()
手册delete()
,它说..
This is a dummy manual entry to satisfy those people who are looking for unlink() or unset() in the wrong place.
这是一个虚拟的手动条目,以满足那些在错误的地方寻找unlink()或unset()的人。
So, it should be 所以,它应该是
<?php unlink("counter.txt"); ?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.