- preg_match: documentation ( source)
- ucwords: documentation ( source)
- implode: documentation ( source)
- explode: documentation ( source)
- strtolower: documentation ( source)
<?php
$str = "NEW APPLE IPHONE X 64GB CVX-Dk46";
$arr = explode(" ", $str);
foreach($arr as &$word){
//var_dump(preg_match("/\d/", $word));
if(!preg_match("/\d/", $word)){
$word = ucwords(strtolower($word));
}
}
echo implode(" ", $arr);