[PHP] calculating psysical path (a first try)

2002-08-01 Thread Lars Olsson
Hi list! Something I use quite often when programming in ASP is the Server.MapPath method. This method expects a virtual path (on the web server) and returns the corresponding psysical path. I haven't seen this anywhere in PHP, so I've hacked my own little routine to do this (see below). But

RE: [PHP] calculating psysical path (a first try)

2002-08-01 Thread Simon Ritchie
I think that you have something like this: $HTTP_SERVER_VARS['SCRIPT_NAME] == '\foo\bar.php' $HTTP_SERVER_VARS[SCRIPT_FILENAME] == 'c:\wwwroot\foo\bar.php' and you want to use this to derive the root 'c:\wwwroot'. You can use one of the standard string edit functions. Something like