0

以下に示す配列と、phpコントローラーに次の行があります。

 if(count($crew_rows != 0)){

Bluehost を php7.2 にアップグレードしたところ、次のエラーが発生しました。

Warning: count(): Parameter must be an array or an object that implements Countable in /home2/sailwbob/public_html/skipper/public/crew.php on line 1885

これを修正するにはどうすればよいですか? (以前のバージョンの php に戻さずに)

    Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 1
                    [skipUsr] => 1
                    [user] => 
                    [crew] => IN
                    [status] => OPEN
                    [avalstart] => 09:00:00
                    [avalend] => 21:00:00
                    [sort] => 0
                    [ssort] => 0
                )

            [1] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 32
                    [skipUsr] => 1
                    [user] => 
                    [crew] => IN
                    [status] => OPEN
                    [avalstart] => 10:00:00
                    [avalend] => 20:00:00
                    [sort] => 9
                    [ssort] => 1
                )

            [2] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 76
                    [skipUsr] => 1
                    [user] => 
                    [crew] => IN
                    [status] => OPEN
                    [avalstart] => 09:00:00
                    [avalend] => 21:00:00
                    [sort] => 9
                    [ssort] => 1
                )

            [3] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 152
                    [skipUsr] => 1
                    [user] => 
                    [crew] => IN
                    [status] => OPEN
                    [avalstart] => 09:00:00
                    [avalend] => 21:00:00
                    [sort] => 9
                    [ssort] => 1
                )

            [4] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 155
                    [skipUsr] => 1
                    [user] => 
                    [crew] => IN
                    [status] => OPEN
                    [avalstart] => 11:30:00
                    [avalend] => 21:00:00
                    [sort] => 9
                    [ssort] => 1
                )

            [5] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 74
                    [skipUsr] => 1
                    [user] => 
                    [crew] => IN
                    [status] => OPEN
                    [avalstart] => 10:00:00
                    [avalend] => 18:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [6] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 25
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [7] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 35
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [8] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 59
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [9] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 69
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [10] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 126
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [11] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 133
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [12] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 153
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

            [13] => Array
                (
                    [date] => 2019-09-17
                    [usr] => 161
                    [skipUsr] => 1
                    [user] => 
                    [crew] => OUT
                    [status] => OUT
                    [avalstart] => 00:00:00
                    [avalend] => 00:00:00
                    [sort] => 9
                    [ssort] => 9
                )

        )

)
4

1 に答える 1