32

私はこのようなものが必要です:

@if ($array.length > 0)
    {{-- expr --}}
@endif

これは可能ですか?

4

2 に答える 2

54

It is possible with the count function, like so:

@if (count($array) > 0)
    {{-- expr --}}
@endif
于 2014-07-18T02:11:30.703 に答える
25

You can use the PHP count function to count the length of an array.

于 2014-07-18T02:10:21.627 に答える