Php 将366个姓名和年龄存储到数组中,并根据当前日期返回值

Php 将366个姓名和年龄存储到数组中,并根据当前日期返回值,php,wordpress,Php,Wordpress,我很难将这种逻辑编码。我需要将366个姓名和年龄存储到一个数组中,并根据当前日期查找返回值。下面的代码片段将使您更好地了解我试图实现的目标 $usernames = array(“John”,”April”); // 366 of them $userages = array(“24”,”32”); //366 of them //returns 0 to 365 Jan 1 = 0 $today = date(“z”); $myusername = $usernames[$today]

我很难将这种逻辑编码。我需要将366个姓名和年龄存储到一个数组中,并根据当前日期查找返回值。下面的代码片段将使您更好地了解我试图实现的目标

$usernames = array(“John”,”April”); // 366 of them
$userages = array(“24”,”32”); //366 of them

//returns 0 to 365 Jan 1 = 0 
$today = date(“z”);

$myusername =  $usernames[$today];
$myage = $age[$today];
我不确定我是否正确处理了这个问题。我非常感谢你的帮助

多谢各位