I have a code which replaces some characters using preg_replace:
$pattern=array(
"#Y#",//full year
"#y#",//short year
"#M#",//month short name
"#F#",//month full name
"#m#",//month number 0 lead
"#n#",//month number
"#t#",//days in month
"#l#",//full week day
"#D#",//short week day
"#d#",//day number of month
"#j#",//day number of month
"#a#",//AM/PM short view
"#A#",//AM/PM full view
"#H#",
"#i#",
"#j#",
"#n#",
"#O#",
"#P#",
"#s#",
"#w#",
);
$replace=array(
$d->ENnum2FA($converted[0]),//year 13xx
$d->ENnum2FA(substr($converted[0],2),true),//year xx lead zero
$d->shmonths[$converted[1]],//month name
$d->months[$converted[1]],//month name
$d->ENnum2FA($converted[1],true), //month number
$d->ENnum2FA($converted[1]), //month number
//$converted[1],
$d->j_days_in_month[$converted[1]],
$d->days[strtolower(gmdate("D",$stamp))],//week day {full view}
$d->ldays[strtolower(gmdate("D",$stamp))],//week day {short view}
$d->ENnum2FA($converted[2],true),//day of month
$d->ENnum2FA($converted[2],true),//day of month
$d->pmam[gmdate('a',$stamp)],
$d->pmam[gmdate('A',$stamp)],
$d->ENnum2FA(gmdate('H',$stamp)),
$d->ENnum2FA(gmdate('i',$stamp)),
$d->ENnum2FA(gmdate('j',$stamp)),
$d->ENnum2FA(gmdate('n',$stamp)),
$d->ENnum2FA(gmdate('O',$stamp)),
$d->ENnum2FA(gmdate('P',$stamp)),
$d->ENnum2FA(gmdate('s',$stamp)),
$d->ENnum2FA(gmdate('w',$stamp)),
);
$date= preg_replace($pattern,$replace,$format);
Now, I want it to replace all those characters in every string except the word "relative". As you can see, the characters "a", "i" , "r" are in the word I want it to remain unchanged. How can I do this?