문제

I am trying to call 2 functions that i have in 2 separate .php files. Let's say that function1() is in my_functions1.php and function2() is in my_functions2.php.

lets say i have in the same folder a third file called main.php and i want to include the functions from both my_functions1.php and my_functions2.php.

Something like this

<?php
include 'my_functions1.php';
include 'my_functions2.php';

function1();
function2();

?>

For some reason i can't have 2 include files. I am kind of new in PHP and it seems that there is nothing on google about this except of putting all the functions in one file.

도움이 되었습니까?

해결책

Try using include_once. You might be accidentally including the same file multiple times.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top