Wednesday 15 August 2012

Get 'My Documents' path in windows using php -



Get 'My Documents' path in windows using php -

i want create temp files within users 'my documents' folder using php. there inbuilt function available in php?

i'll assume you're running php locally on users pc...

you can user profile folder via $_server superglobal:

$_server['userprofile']

appending documents should point default path. running next @ command line:

php -r "echo $_server['userprofile'] . '\documents';"

gives:

c:\users\<username>\documents

note: it's possible move location of documents folder not bullet-proof method.

php windows-8 windows-7

No comments:

Post a Comment