<?php $arr = 20; $data = str_replace(array(10,20,30,40),array("blue","red","green","yellow"),$arr); print_r($data);