xxxxxxxxxx
$text = "The Quick : Brown Fox Jumped Over The Lazy / Dog";
$splitstring1 = substr($text, 0, floor(strlen($text) / 2));
$splitstring2 = substr($text, floor(strlen($text) / 2));
if (substr($splitstring1, 0, -1) != ' ' AND substr($splitstring2, 0, 1) != ' ')
{
$middle = strlen($splitstring1) + strpos($splitstring2, ' ') + 1;
}
else
{
$middle = strrpos(substr($text, 0, floor(strlen($text) / 2)), ' ') + 1;
}
$string1 = substr($text, 0, $middle); // "The Quick : Brown Fox Jumped "
$string2 = substr($text, $middle); // "Over The Lazy / Dog"
xxxxxxxxxx
$alphabet = array("a", "b", "c", "d", "e","f");
$firsthalf = array_slice($alphabet, 0, count($alphabet) / 2);
$secondhalf = array_slice($alphabet, count($alphabet) / 2);