You are here: Re: include files with similar contents « PHP Programming Language « IT news, forums, messages
Re: include files with similar contents

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация