PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The issue seems to be that "file_get_the_contents($url) ; " is causing the error because it is not defined until after the function runs. I attempted to move the whole line below the function and as a result got a 403 error for the whole page.
Normally you can call functions at any time because PHP preprocesses the file and sees the function. But you put it in a conditional, so PHP has to wait until execution makes it there (if it does) before the function can be defined.
Doing it in your code doesn't make sense. In fact, your code doesn't make sense period.