How It Works

@foreach($howItWorkArticles as $k => $newsArticle) @php preg_match_all('/<([^>]+)>(?:([^<]+))*(?=[^>]*\<)/',$newsArticle->body,$matches); $strings = array_pop($matches); $shortDescription = ''; foreach ($strings as $string) { $string = trim(str_replace(' ', ' ', $string)); if (strlen($string) != 0){ $shortDescription .= $string; } } @endphp @php($id = Crypt::encrypt($newsArticle->id))

{{ ( strlen($shortDescription) > 80 )? substr($shortDescription, 0, 150).'...': $shortDescription }}

{{ ucwords($newsArticle->title) }}

@endforeach