$half = (int) ( (strlen($userlist) / 2) ); $left = substr($str, 0, $half);//$left now holds the first half of the string.