Im new in Magento, I need to delete a file and its containing folder, which has a name generated by the following code:
$order = Mage::getModel('sales/order')->load($id_order);
$increment = $order->getIncrementId();
if (!file_exists(Mage::getBaseDir('base').'/Ocproveedores/'.$increment)) {
mkdir(Mage::getBaseDir('base').'/Ocproveedores/'.$increment, 0777, true);
}
$tcpdf->Output(Mage::getBaseDir('base').'/Ocproveedores/'.$increment.'/OC-'.$nombreProveedor.'-'.$increment.'-'.$j.'.pdf', 'F');
How can I delete the folder after ending an order ?
Thanks a lot.