Posted by Gunnar G on 02/06/07 08:54
>> You can use classes :
>> <?php
>> class a
>> {
>> include "a.php";
>> }
>> class b
>> {
>> include "b.php";
>> }
>>
>> a::foo();
>> b::foo();
>> ?>
Wait a minute, are you sure this works?
I try
include("page.php");
class a
{
function foo($x){return $x+1;}
}
class b
{
function foo($x){return $x+1;}
}
which works, but moving the include line to this
class a
{
include("page.php");
function foo($x){return $x+1;}
}
class b
{
function foo($x){return $x+1;}
}
and it no longer works.
Navigation:
[Reply to this message]
|