home resources search newsjoinmembers: 6960
PHP Flash Java Ruby Windows Linux
php | Wed, 2008-04-02 08:48  tags: ,

One of the most frustrating things about using third party scripts to developing in PHP is the fact that litterally none of them check for the operative system. PHP is pretty universal but there are many things which differ or are dependant on a particular server operative system.

To find the server os there is the predefined constants. I often use this for determining between Windows and all others:

<?php

if (stristr(php_os'WIN')) {
 
// Win 
} else {
 
// Other
}
?>

Simple and easy. While you are at it you may want to read up on the many built-in constants and functionality of PHP it will save you loads of time in the future.

printer-friendly version

php's picture
Pia Weathers - database systems engineer
Thoughtbox - So what did you think?



 
 
Web Developers Drupal eRuby Content Management Systems Silverlight Drupal
 videos
 articles
 blogs
 comments
 downloads
sitemap

Newsletter

Get updates on Hiveminds services, articles and downloads by signing up for the newsletter.

Editor's choice

Some of the better articles, stories and tutorials found at Hiveminds.

Find more

Find more of Hiveminds articles, stories, tutorials and user comments by searching.




Picked links

Hand picked websites and articles from around the web that provide quality reading.

page top