You need to loop through the array and check each value. If the value is of x, then change that value to y.

Here is some pseudo code:


a = new array()
for (each element in a) {
if...