array_map with unlink, using a wild card not working
Here's what I currently have:
$pic_path provides a path like so: path/to/img
$toid is a number, and like pic_path, no slash before or after.
$file_path = glob( $pic_path . "/" . $toid . ".*" );
array_map('unlink', $file_path);
The picture I am trying to delete is indeed in the specified path.
I've tried using
$file_path = glob( $_SERVER['DOCUMENT_ROOT'] . "/" . $pic_path . "/" .
$toid . ".*" );
array_map('unlink', $file_path);
and I've also tried replacing the * wild card for the actual image
extension, and it also failed.
Any idea?
No comments:
Post a Comment