you can find the currant servers domain name using the HTTP_HOST server variable:
<?php echo((isset($_SERVER["HTTP_HOST"]))?$_SERVER["HTTP_HOST"]:"") ?>
Create a switch statement to select which key should be used based on that variable:
<?php
switch ($_SERVER["HTTP_HOST"]) {
case "www.mydomain.com": $key = "key1"; break;
case "www.otherdomain.com": $key = "key2"; break;
case "www.someotherdomain.com": $key = "key2"; break;
default: $key = "default key"; break;
}
?>
then change the script tag that connects to the google api to use the new $key variable:
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $key; ?>">/*wagmp*/</script>