upload multiple images and resize
Formatting
I'd recommend looking at the accepted PSRs - e.g. PSR-1, PSR-12. Updating the code to comply with them will help make the code readable and consistent with idiomatic PHP code.
Maybe this is just a copy-paste issue, but even if you don't strictly follow PSR-12 please indent nested lines within blocks.
Array syntax
As of the time of writing, PHP 7 has Active support for versions 7.4 and 7.3, and since PHP 5.4 arrays can be declared with short array syntax (PHP 5.4) - i.e. [&quot;gif&quot;,&quot;jpeg&quot;,&quot;jpg&quot;,&quot;png&quot;].
Redundant lines
If you aren't familiar with the principle Don't repeat yourself I recommend reading about it:

The Don’t Repeat Yourself (DRY) principle states that duplication in logic should be eliminated via abstraction;

Let's look at a few place that are redundant:

if ((($_FILES['upload_images']['type'][$i] == &quot;image/gif&quot;) 
|| ($_FILES['upload_images']['type'][$i] == &quot;image/jpeg&quot;)
|| ($_FILES['upload_images']['type'][$i] == &quot;image/jpg&quot;)
|| ($_FILES['upload_images']['type'][$i] == &quot;image/pjpeg&quot;)
|| ($_FILES['upload_images']['type'][$i] == &quot;image/x-png&quot;)
|| ($_FILES['upload_images']['type'][$i] == &quot;image/png&quot;))
&amp;&amp; ($_FILES['upload_images']['size'][$i] &lt; 12000000)
&amp;&amp; in_array($ext,array(&quot;gif&quot;,&quot;jpeg&quot;,&quot;jpg&quot;,&quot;png&quot;))){


The last conditional uses in_array() - why not use that for checking the type? That way there is no need to repeat $_FILES['upload_images']['type'][$i] for each type:
if (in_array($_FILES['upload_images']['type'][$i], 
     [&quot;image/gif&quot;, &quot;image/jpeg&quot;, &quot;image/jpg&quot;, &quot;image/pjpeg&quot;, &quot;image/x-png&quot;, &quot;image/png&quot;])
    &amp;&amp; ($_FILES['upload_images']['size'][$i] &lt; 12000000)
    &amp;&amp; in_array($ext, [&quot;gif&quot;,&quot;jpeg&quot;,&quot;jpg&quot;,&quot;png&quot;])) {

Also the switch statement has three cases that do the same thing: 'jpg', 'jpeg' and default - so those first to can be eliminated.
Tri-state variable $is_jpg
This variable has three possible values, yet has a name that might be conceived as a boolean. And somebody reading the code might not know what the values 1, 2 and 3 signify without scanning through the code to see where those values are assigned. I'd suggest eliminating it and instead of checking to see if the value is 1, 2, or 3, check to see if $ex is 'jpg', 'png', or 'gif' since those values are already being set.