<?php

error_reporting(-1);
mb_internal_encoding('utf-8');

$text0 = "ну что.      не смотрел еще black mesa.я собирался скачать  ,но все как-то некогда было.";
$text1 = "roses are red,and violets are blue.whatever you do i'll keep it for you.";
$text2 = "привет.есть 2 функции,preg_split и explode ,не понимаю,в чем между ними разница.";
$textArray = array($text0, $text1, $text2);

foreach ($textArray as $currentSentence) {
	$sentenceBreak = preg_split('/[.]/', $currentSentence);
	foreach ($sentenceBreak as $singleSentence) {
		toUpperCase($singleSentence);
	}
}

function toUpperCase ($sentence) {
	echo(ucfirst($sentence));
}