You are here: Re: The principle of include files in PHP, not as in C++ « PHP Programming Language « IT news, forums, messages
Re: The principle of include files in PHP, not as in C++

Posted by Tim Roberts on 10/16/07 06:10

Jerry Stuckle <jstucklex@attglobal.net> wrote:

>duzhidian@gmail.com wrote:
>>
>> I can organize the codes, but it does not seems as transparent as what
>> c/c++ does as one file at root have to consider it's grandsons'
>> functions (location), not supposed to do that in c/c++.
>
>You're still using relative paths. Anything starting with ".", ".." or
>a path name is relative.
>
>Absolute paths start with / in linux/unix.
>
>It works exactly the same in C/C++. Relative paths there are relative
>to the executable.

You missed the point. He's talking about #include files, and he is quite
correct. In C/C++, you never ever ever use an absolute pathname in an
#include statement. Further, the preprocessor rule is that relative paths
in an #include statement are relative to the directory that contains the
file being scanned.

PHP's rules are different. Not better, not worse. Just different.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

 

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

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