Tuesday, November 16, 2010

PHP: Get the OS name

You can get the OS name at where the php script is running using system commands. At one of my php application, I was looking for the exact function. Not interested to use the system command. Below is what I have used that time.



$os_name = php_uname('s');
print $os_name;



The output will be "Windows NT" if you run this from your windows.

No comments:

Get function name programaticaly - Python

This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...