Hi Eric, thanks for those comments. With your prompting I did some more hunting around and looked through the source code for "phpinfo(" in /ext/standard/info.c and found php_uname() which is in the manual :) although from the name you might never guess it is what you need. However, the documentation says: - Returns information about the operating system PHP was __built__ on [my underlining]
Which is not true. If PHP was build on a WinNT4 box but is running on a WinXP box, it is going to report the OS platform and version for WinXP. So the docs need a little correction here. I'm tempted to add my first ever "user contribution" comment on this, but it seems like a pretty minor point. John P.S. I didn't have any problem searching for EXTR_REF in the docs. It was simply an example of why a hyperlink would reduce confusion and simplify navigation (aka searching) the docs. ----- Original Message ----- From: "Eric Gach" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "'John M. Calvert'" <[EMAIL PROTECTED]> Sent: Sunday, March 23, 2003 3:23 PM Subject: RE: [PHP-WIN] determine host platform - win32 / *nix John, I've talked this issue over before with some of the PHP development/documentation team. Most of them seem to think that all of the constants are self explanatory. If you search for EXTR_REF in the manual search, it shows http://www.php.net/function.explode where there is an explanation for it. As for the version number... I think there is something in the $_SERVER variable. Check you’re a phpinfo() page to find out. Hope that helps. ~ Eric Gach EvilWalrus.com Co-Administrator -----Original Message----- From: John M. Calvert [mailto:[EMAIL PROTECTED] Sent: Sunday, March 23, 2003 7:08 AM To: [EMAIL PROTECTED] Cc: Eric Gach Subject: Re: [PHP-WIN] determine host platform - win32 / *nix Thanks Eric. This constant PHP_OS doesn't give the OS version number. I don't need that at this moment, but it would be useful to distinguish. OS funtionality can change as much from one version to the next as from one platform to another. How do I go about submitting this as a feature suggestions for PHP? BTW, while it is true that PHP_OS appears in the manual, it's meaning is not defined anywhere. The following man pages: /manual/en/reserved.constants.core.php /manual/en/reserved.constants.standard.php list a number of predefined constants, but don't say what they mean, nor what if any function they are associated with. Isn't that kind of important? A hyperlink from these lists of constants to any associated functions would be quite useful. For example, take a guess at "EXTR_REF". I'm sure PHP experts know the answer, but what about those of us learning the language. For the latter I'd like to submit a documentation suggestion. I'll try forwarding this message to [EMAIL PROTECTED] John ----- Original Message ----- From: "Eric Gach" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "'John M. Calvert'" <[EMAIL PROTECTED]> Sent: Saturday, March 22, 2003 6:57 PM Subject: RE: [PHP-WIN] determine host platform - win32 / *nix > There's a few examples of this in the manual somewhere... but here's > some basic code for it: > > if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) > dl('module.dll'); > else > dl('module.so'); > > Hope that helps. > > ~ Eric Gach > EvilWalrus.com Co-Administrator > > -----Original Message----- > From: John M. Calvert [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 22, 2003 8:03 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] determine host platform - win32 / *nix > > Hello, how do I determine from code the host platform running PHP? For > example, php.dl() requires a different module name under Win32 and *nix > so > for more portable code I would like to write something like: > if (php_platform() == WIN32) > dl('module.dll'); > else > dl('module.so'); > > Does this exist? > > John M. Calvert, M.Sc., MCSD > > 1310521 Ontario Inc. > 49 Belmont Ave. > Ottawa ON K1S 0V2 > (613) 730-9851 > http://members.rogers.com/john-m-calvert/ -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php