Skip to content
Advertisement

PHP, how do I pass variables between methods?

I’m trying to pass a variable from one method to another.

I’m fetching dates from an events table in order to build a dynamic query in another method.

JavaScript

this returns my sumCase array without problems, I’m now trying to access this sumCase array in another method in order to build the query:

JavaScript

when I echo my sumCase array within this method, it returns null. How do I access the value of the sumCase array from the getEvents method?

Advertisement

Answer

It returns null if function getEvents wasnt called first or it was called not to same instance of object.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement