Hello all,

I have 3 scripts script1.php and script2.php where both include the same general.inc file of functions. Then I have script3.php that calls functions from both scritp1.php and script2.php. As both script1 and script2 include general.inc when I try to use diferent function on script3 I have a circular problem that functions on general.inc are declared twice. Therefore, how can I solve this circular include problem? Can anyone help me? In C++ you have the pragma keyword to avoid this. What can be done in PHP?

When I do a include_once() the problem stays the same.

Thanks in advance.

Here's the scenario in case what I wrote is complicated.

script1.php :
<?php
   include("general.inc");

  functions......
?>


script2.php : <?php include("general.inc");

  functions......
?>

script3.php :

<?php
   include("script1.php");
   include("script2.php");

   call script1 functions

   call script2 functions

  functions......
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to