Advanced PHP |
 |
2025-02-27 |
 |
 |

62 |
 |
 |
SAPI is the Server abstraction API and you can access server-related
global variables using the SG() macro. Include
SAPI.h in your .c file to get the SG macro. You
can then access the elements of the sapi_globals_struct
which looks like this:
To access the default MIME type, you would use:
And to access the request_uri you would use:
Executor Globals
These are run-time globals. The ones you are likely to be interested in are
the symbol_table and active_symbol_table globals. For example, to access
the user-space $foo variable from the current global context, you would do
this: