I have script showing profile pictures of users from my site but it’s hardcoded to only show jpg, problem is that users can upload png and gif as well and when that happens their picture is not displayed, how can I fix this, not changing this line too much as it’s part of the bigger thing and it can’t be all reworked just for this one line?
$imgurl =$_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["HTTP_HOST"] . "/files/pictures/picture-" . ($user_id) . ".jpg";