I am beginning to use Slim for REST/Json web services. Now, after initial tests, I realize that I would need to include PHP code which I use for my "normal" web application, in order to calculate the right values to be returned. [That is, instead of returning national statistics, I calculate per capita data or indexed values or aggregations.]
Now, my PHP code in the included file (see below, B) calls a function from another file (C). This works fine. But the value generated in that function is not being brought back to the first file (B).
- A: Code Slim level.... include (xx.php, yy.php)
- B: xx.php: call_to_function_from_yy()
- C: yy.php: generate result; global $results (with $results having indeed values)
- B: $results is empty
Any hints why that would be and what I can do? Thanks a lot!