I’ve spent a lot of time on google looking for tutorials or references on how to use callback functions. In particular, I’m trying to find out how to use a callback function within a class.
For instance, part of my class attempts to parse an xml file. To register the xml handle, I call the xml_set_element_handler() function:
xml_set_element_handler($parser, “start” , “end”);
where “start” and “end” are callback functions.
The problem is, I cannot call another function within a class without using the $this-> handle. But, this won’t work for the callback function. In other words, calling the function like $this->”start” does not work. So, how do I do this inside a class?
Again, I couldn’t find a darn thing on google. So, if you want your effective answer at the top of search engines, go at it. Thanks.