BenitoDannes

_deleteImage

Mar 10th, 2020
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. private function _deleteImage($id)
  2. {
  3.     $product = $this->getById($id);
  4.     if ($product->image != "default.jpg") {
  5.         $filename = explode(".", $product->image)[0];
  6.         return array_map('unlink', glob(FCPATH."upload/product/$filename.*"));
  7.     }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment