Copy Files From One Folder To Another Folder

Fetch data From Database Colum values then Copy these files into another Folder -- like filter data

20

Arun Kr.
04-Feb-25
$product         =  $Uni->get('product'); 
// dd($product);

foreach( $product as $key => $Data )
{    

    if(!empty($Data['product_image']))
    {      

        $source = './assets/products_filter/'.$Data['product_image']; 
        $destination = './assets/products_final/'.$Data['product_image']; 

        if (copy($source, $destination)) 
        {
            // echo "File copied successfully!";
        } 
        else 
        {
            echo $Data['id'].'--'.$Data['product_image'].'======='."Failed to copy file.";
            echo '</br>';
        }

    }
}
@Since 2024 Arun'Log Powered by Arun Git