Calculate Aspect Ratio of Image or Video in PHP

Calculate Aspect Ratio of Image in PHP

Sometimes during in PHP web application development, we come across a need where we require to calculate the aspect ratio of the image based on its width and height. Below PHP function will return aspect ratio for eg. width is 1920 and height is 1080…