I am not sure if this was shared before but here's the script.
<?php
include("gyr.php");
?>
------------------------------------------------------------------
Code for gyr.php
<?php
$locales = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
if ( $locales == "" ) {
include("google-728x90.php");
} else {
$semicolon = array(";");
$lesssemicolon = str_replace($semicolon, ",", "$locales");
$breakdown = explode(",",$lesssemicolon);
$lang_count = strtolower("$breakdown[0]");
}
if ( $lang_count == "en-us" ) {
include("ypn-728x90.php");
} else {
include("google-728x90.php");
}
?>
then create php pages named "ypn-728x90.php and google-728x90.php which contain your ad code