How to fix width and height of image when upload multiple images using codeigniter?

How to fix width and height of image when upload multiple images using codeigniter?

controller:

controller:

public function products()
{
    date_default_timezone_set("Asia/Calcutta");

$dataInfo = array();
$files = $_FILES;
$cpt = count($_FILES['product_image']['name']);
for($i=0; $i<$cpt; $i++)
{           
    $_FILES['product_image']['name']= $files['product_image']['name'][$i];
    $_FILES['product_image']['type']= $files['product_image']['type'][$i];
    $_FILES['product_image']['tmp_name']= $files['product_image']['tmp_name'][$i];
    $_FILES['product_image']['error']= $files['product_image']['error'][$i];
    $_FILES['product_image']['size']= $files['product_image']['size'][$i];
    $this->upload->initialize($this->set_upload_options());
            $this->upload->do_upload('product_image');
            $upload_data = $this->upload->data();
            $name_array[] = $upload_data['file_name'];
            $fileName = $upload_data['file_name'];
            $images[] = $fileName;
}

$fileName = $images;
$data = array(
        'product_image' => implode(",",$fileName)
    );
$sql = $this->db->insert('add_product',$data);
if($sql == true)
{
    echo '<p style="color:green;">New Product Added</p>';
}
else
{
    echo '<p style="color:red;">Unable to Proceed!</p>';
}

}

private function set_upload_options() {
$config = array(); $config['upload_path'] = FCPATH.'resource/product/'; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['max_size'] = '1024'; $config['overwrite'] = FALSE; return $config; }

In this code I am upload multiple images via jquery ajax which work perfectly. Now, I want that when I upload multiple images then I also fix its widht and height of all images. So, How can I do this? Please help me.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Know CodeIgniter and Reasons that attract developers towards it

PHP is a most versatile general-purpose scripting language Since 1994 developers are leveraging its benefits in the development process. It offers extensive features and frameworks to develop websites easier and faster. There are several PHP...

jQuery ajax get request method example

### jQuery Ajax Get Request Method Example This article is originally published at [https://www.tutsmake.com/jquery-api-ajax-get-method-example/](https://www.tutsmake.com/jquery-api-ajax-get-method-example/...