All Questions
4
questions
1
vote
1
answer
41
views
Why is my class not visible outside the file? [closed]
I have 2 PHP files as part of a website. The first one has the API functions (pre made ready to use requests), and the other one has the code itself that will call the functions from the first one.
...
2
votes
3
answers
2k
views
PHP: how to access variables inside a function that have been declared outside of it?
At the very beginning of each page I include a file that starts the SESSION etc, lets call it session.php. In this file session.php, I include a file that contains a function, let's call it function1....
0
votes
3
answers
165
views
PHP include file that includes a file strange problem!
I face a strange problem including php files. Let me show you the code:
// constants.php
$MYSQL_HOST_PORT = 'localhost:3306';
// functions.php
include 'constants.php';
function getVar() {
echo $...
2
votes
4
answers
6k
views
How can I see a variable defined in another php-file?
I use the same constant in all my php files. I do not want to assign the value of this variable in all my files. So, I wanted to create one "parameters.php" file and to do the assignment there. Then ...