PHP Includes failing to include file from subdirectory?
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Grumble time! Microsoft also succeeded in standardizing the errors in JavaScript as opposed to standardizing the correct behaviour because they didn't want to break stuff and now we are forever stuck with such wonders as:It's only microsoft who decided to be different.
Code: Select all
alert(typeof null) // "object"- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Difting off topic, but I love this error:ole wrote:Grumble time! Microsoft also succeeded in standardizing the errors in JavaScript as opposed to standardizing the correct behaviour because they didn't want to break stuff and now we are forever stuck with such wonders as:It's only microsoft who decided to be different.Code: Select all
alert(typeof null) // "object"
"Error: Object expected. Code: 0".
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
PATH_SEPARATOR - Typically ';' or ':' (though I can't really think of anything else it would be).
DIRECTORY_SEPARATOR - Typically either '\' or '/' (and again, not sure if there are others).
I think there is another one (PHP_EOL) that puts out the '\n' or '\r' or '\r\n' depending the system. Doesn't it make sense to use them when developing apps for unknown systems? Maybe I am just weird?
DIRECTORY_SEPARATOR - Typically either '\' or '/' (and again, not sure if there are others).
I think there is another one (PHP_EOL) that puts out the '\n' or '\r' or '\r\n' depending the system. Doesn't it make sense to use them when developing apps for unknown systems? Maybe I am just weird?
- maliskoleather
- Forum Contributor
- Posts: 155
- Joined: Tue May 15, 2007 2:19 am
- Contact:
yes, but, honestly, it isnt a major nessicity to use them, with a few exceptions.Everah wrote:Doesn't it make sense to use them when developing apps for unknown systems? Maybe I am just weird?
I mean, PHP natively uses the '/' as a directory separator, so its not really nessicary to use it in include paths, only when passing paths to an external program.
and really, how often does anyone use the path separator? Its not that hard to use that constant.
really, the true advantages of DIRECTORY_SEPARATOR and PHP_EOL are for saving files and passing information to other on-server programs( ie system(); ) .PATH_SEPARATOR should always be used, just for consistancy and usability among other systems