Reply to Re: include files with similar contents

Your name:

Reply:


Posted by lorento on 02/06/07 04:30

You can use classes :
<?php
class a
{
include "a.php";
}
class b
{
include "b.php";
}

a::foo();
b::foo();
?>

http://www.mastervb.net/phpbooks/
http://www.mastervb.net
On Feb 6, 3:56 am, Gunnar G <deb...@comhem.se> wrote:
> Hi.
> Another question for you guys, you are very helpful.
> If I have the files a.php, b.php, c.php and I must include them, but they
> all contain the same function foo(), is there a way to tell PHP to call the
> function foo from a.php, foo from b.php , and so on? Or will the last
> included file replace the previous foo() functions?
>
> Any suggestion on a workaround? Can I call afile.php which inclueds a.php
> and runs foo() from a.php?
> Or will I have to rewrite all the files a.php, b.php, etc. ?
> --
> I didn't know sci.bio.paleontology was that low traffic until I tried read
> the thread "Where is everyone?" and found it to be expired.

[Back to original 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

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