$trans = array('0' => 'zero','1' => 'one', "2" => "two",...,"9" => "nine");
echo strtr("three five five - seven five eight - zero three eight four", $trans);
or
$text = " {NUMBER} {TEXT} ";
$text = str_replace(array('{NUMBER}', '{TEXT}'), array('355-758-0384', 'The text itself'), $text);
print $text; // Outputs 355-758-0384 The text itself
or
$string="355-758-0384";
$search = array(0,1,2,3,4,5,6,7,8,9);
$replace = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');
echo str_replace($search, $replace, $string);
or
$str = "San Jose, California" ;
echo substr_replace($str, '', strpos($str, " "), 1);
or
$string = "San Jose, California";
$values = explode(",", $string);
foreach($values as &$value)
{
$value = str_replace(" ", "", $value);
}
$output = implode(", ", $values);
or
$your_string="San Jose, California";
$arr = explode(" ", $your_string);
$result = $arr[0] . $arr[1] . " " . $arr[2];