home forums resources search newsjoinmembers: 5241
Joomla Wordpress Drupal Fireorb Flash Java PHP Ruby Windows
 videos
 articles
 blogs
 comments
 downloads
sitemap
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
 
 

Newsletter

From time to time We update Hiveminds services, articles and downloads. A new or updated CMS may be added to the Comparison Matrix, Demo Matrix or a new feature added to the Search Matrix. Get notified about updates 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