直接以下网址打开get提交,2位字母的国家简称ru br ee ua us ca
gb cz pt at ph es lt gr dk jp si fr in ch eg rs it lv bg au id kg fi ro by ma ae za kz tm kr bd il nl de vn pl cl am be sa md mx sg cy no tr tj tw uz se hk th my,每次只能get一个国家
https://www.125xx.com/i346.php?country=my
i346.php内容如下
<?php error_reporting(0);
$country = $_GET['country'];
header ('Content-Type: text/plain'); // plain text file
echo file_get_contents("https://xxx.xxx/api/de66d2-60d8d2ea61-462b/getcount?version=4&country=$country");
?>
需求:
i346.php判断 如果get来的是ru br ee ua us ca这5个国家其中之一
其中 version=4 就更换3 如果不是ru br ee ua us ca国家那不理会依然version=4
例如是ua version=3
https://xxx.xxx/api/de66d2-60d8d2ea61-462b/getcount?version=3&country=ua
例如au 保持默认version=4 不变
https://xxx.xxx/api/de66d2-60d8d2ea61-462b/getcount?version=4&country=au
i346.php 用php应该怎么写才最优化来实现以上需求