I ask those who wish and who are in the know to share ideas on how to implement this. The only thing that my tired brain thought of in the last 15 minutes
$a = array('John', 'Brad'); $b = array('Doe', 'Born'); if(in_array('John', $a)) { foreach($a as $k => $v) { if($v == 'John') { echo $b[$k]; } } }
and frankly little inspired for successful fast work.
In short, you need to pull the index out of the array $a
, transfer it to the array $b
and print the result. $b[$k];