This question has already been answered:
There are links with such endings.
?w=wall239752675_488 ?z=photo239752675_384467374 how to check
if there is w then we do that
if there is z then we do that
The condition can of course be written with the help of if else. But how to get from the link is w and z I won’t even build the mind.
if (isset($_REQUEST['w'])) {...}, in your case, instead of $ _REQUEST, you can use $ _GET - BOPOHphp. - Visman