или
function setDot($str){
$temp = preg_split("##is", $str, -1, PREG_SPLIT_NO_EMPTY);
$result = null;
$pos = rand(1, (count($temp)-1));
foreach($temp as $k=>$letter){
if($k == $pos)
$result .= '.';
$result .= $letter;
}
return $result;
}
или сократить
function setDot($str, $result = null){
$temp = preg_split("##is", $str, -1, PREG_SPLIT_NO_EMPTY);
$pos = rand(1, (count($temp)-1));
foreach($temp as $k=>$letter){
if($k == $pos) $result .= '.';
else $result .= $letter;
}
return $result;
}
echo setDot('anyword');
_____________
HTML, CSS (Bootstrap), JS(JQuery, ExtJS), PHP, MySQL, MSSql, Posgres, (TSql, BI OLAP, MDX), Mongo, Git, SVN, CodeIgnater, Symfony, Yii 2, JiRA, Redmine, Bitbucket, Composer, Rabbit MQ, Amazon (SQS, S3, Transcribe), Docker