- strtr: documentation ( source)
- var_export: documentation ( source)
<?php
$rule = [
"c" => "d",
"a" => "o",
"t" => "g",
"h" => "a",
"1" => "@",
"e" => "n",
"n" => "t"
];
$orders = ['cat1hen','cathen','hencat'];
foreach($orders as $order){
$result[] = strtr($order, $rule);
}
var_export($result);