1
各特定のカテゴリに含まれる単語の数をカウントする必要があります。たとえば、私の場合は、今、特定のリスティングにいくつの単語が含まれているかを数えます。グループワード数変換テーブルLaravel 5.3
@if (str_word_count($stats->description) < 250)
0 - 249
@elseif(str_word_count($stats->description) >= 250 && str_word_count($stats->description) <= 500)
250 - 500
@elseif(str_word_count($stats->description) >= 501 && str_word_count($stats->description) <= 750)
500 - 750
@else
750+
@endif
最後に、各カテゴリでカウントする必要があるテーブルがあります。このように:
<table class="table table-condensed table-responsive">
<thead>
<tr>
<th class="text-center" colspan="6">Conversion Rate For Word Count</th>
</tr>
<tr>
<th>0 - 249 words</th>
<th>250 - 500 words</th>
<th>500 - 750 words</th>
<th>750 + words</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
0-249語などのすべてのリストはどのように数えますか?
はい、動作します – David