- var_dump: documentation ( source)
- str_replace: documentation ( source)
<?php
$list = [];
$list[] = "TALB20170826D-\$A$$-RA11.pdf";
$list[] = "TAP$20170826D-\$A$$-RA11.pdf";
$list[] = "TASD20170826D-\$A$$-RA11.pdf";
$list[] = "TAUA20170826D-\$A$$-RA11.pdf";
$list[] = "TAUB20170826D-\$A$$-RA11.pdf";
$list[] = "TAUC20170826D-\$A$$-RA11.pdf";
$list[] = "TAUD20170826D-\$A$$-RA11.pdf";
$list[] = "TBTP20170826D-\$A$$-RA11.pdf";
$list[] = "TCBY20170826D-\$A$$-RA11.pdf";
$abbr = [
"TALB",
"TAP",
];
$replacements = [
"ALBANY",
"Asia Pacific",
];
foreach ($list as &$el) {
$el = str_replace($abbr, $replacements, $el);
}
var_dump($list);