Update: It seems like it is just a regex problem.
I am trying to remove all extra whitespace, line-breaks, and empty spaces from user story with a function to grab only 100 characters
Issue is although 100 character limit works, the removing of whitespace, linebreaks and empty spaces does not apply:
function aboutme_echo($x, $length)
{
if(strlen($x) <= $length)
{
echo $x;
}
else
{
$y = substr($x,0,$length) . '...';
echo $y;
}
}
aboutme_echo((preg_replace("/\s+/"," ", $aboutme)), 100);
Example String: