Considering this is a bootstrap modal (which it looks like it is), you can create a JavaScript function and echo it out in PHP. Something like this:
echo '<script type="text/javascript">',
'$("#modal-id").modal("toggle")',
'</script>';
The example above is form the Bootstrap 4 Docs where it demonstrates calling the modal from javascript. Once that script is echoed from your PHP, it'll run on the page and load the modal.
To Clarify: Even if this isn't a bootstrap modal, you can still use the same JavaScript technique to add/remove a class to the modal which you can style to make it show/hide.