• Posted: 2011-01-23
  • Author: Marko Petkovic
  • Tags:

Different content for Mac and Win

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
<?php
if (stristr($_SERVER['HTTP_USER_AGENT'],"mac")) {
	echo 'Hello, Im a Mac.';
} else {
	echo 'And Im a PC.';
}
?>

Instructions:

Display different content to Mac and Windows users (example:software download link for different platforms).


Share this snippet

If you like this snippet, share it with friends!