I have a method / function (in a class) that I am calling and I want to pass either and id or a url. The method then uses one of these arguments in a mysql WHERE query. It can only use one or the other.
How can I require one of two arguments? Or in other words how can I only make one of two arguments optional?
Is there a better way than to just make both arguments optional and use several if else statements?
If you want to literally require an argument: