Managing Dynamic Function Calls

Chapter 6 shows you how to pass a customized sort function into a predefined sorting function. The ability to do so, in your own library functions, is a powerful tool. This section will demonstrate how you pass a function name to make a dynamic function call.

The mechanism to make dynamic function calls is tied to how variables are managed in PHP. You can define a function in your page, or library, and then pass the name of the function as a string and its parameters as a list to another function. Inside the function, you append parentheses containing the actual parameter list to the variable that contains the function name. This statement makes a dynamic function call to the function represented by the string ...

Get Oracle Database 10g Express Edition PHP Web Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.