Jump to content

Determine OS with PHP.


aximbigfan

Recommended Posts

/ works in file system paths in both operating systems.

 

Do you have an example of something you are trying to do that does not work?

 

Actually, I was trying to solve a problem before it started.

 

So I could do a

file_put_contents("test/test123/test.txt","This-is-a-test");

on Windows and it would work?

 

Thanks,

Chris

/ works in file system paths in both operating systems.

 

Do you have an example of something you are trying to do that does not work?

 

Actually, I was trying to solve a problem before it started.

 

So I could do a

file_put_contents("test/test123/test.txt","This-is-a-test");

on Windows and it would work?

 

Thanks,

Chris

 

Yes, php is smart enough to change / to \ on windows. Theres always the php_uname() function though, just to answer your question.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.