How I can count same values in the Array. I have read about the array_count_values() but this function can only count Integer or String values but My problem is that I want to count same dates in the Array, How can I count the same dates in the Array.
I have tried this array_count_values() but this gives me this error.
A PHP Error was encountered
Severity: Warning
Message: array_count_values(): Can only count STRING and INTEGER values!
Filename: controllers/Dashboard.php
Line Number: 72
Backtrace:
File: /opt/lampp/htdocs/blink_app/application/controllers/Dashboard.php
Line: 72
Function: array_count_values
File: /opt/lampp/htdocs/blink_app/index.php
Line: 315
Function: require_once
And Here Is my Array.
Array
(
[0] => stdClass Object
(
[id] => 1
[saloon_staff_id] => 1
[users_id] => 5
[ref_id] => 1
[date] => 2017-11-02
[time_from] => 12:15:00
[time_to] => 13:30:00
[appointment_status] => 2017-11-23
[saloon_services_id] => 3
[saloon_profiles_id] => 1
[phone_number] => 098098098
[email] => [email protected]
[appointments_enabled] => 1
[role_in_saloon] => Owner
[name] => Salman Iqbal
)
[1] => stdClass Object
(
[id] => 2
[saloon_staff_id] => 2
[users_id] => 6
[ref_id] => 2
[date] => 2017-11-02
[time_from] => 04:30:00
[time_to] => 05:00:00
[appointment_status] => 2017-11-25
[saloon_services_id] => 2
[saloon_profiles_id] => 1
[phone_number] => 98790809809
[email] => [email protected]
[appointments_enabled] => 1
[role_in_saloon] => No Access
[name] => Alludin
)
[2] => stdClass Object
(
[id] => 1
[saloon_staff_id] => 1
[users_id] => 7
[ref_id] => 3
[date] => 2017-11-04
[time_from] => 03:00:00
[time_to] => 03:30:00
[appointment_status] => 2017-11-28
[saloon_services_id] => 2
[saloon_profiles_id] => 1
[phone_number] => 098098098
[email] => [email protected]
[appointments_enabled] => 1
[role_in_saloon] => Owner
[name] => Salman Iqbal
)
[3] => stdClass Object
(
[id] => 3
[saloon_staff_id] => 3
[users_id] => 7
[ref_id] => 4
[date] => 2017-11-28
[time_from] => 01:00:00
[time_to] => 02:00:00
[appointment_status] => 2017-11-28
[saloon_services_id] => 1
[saloon_profiles_id] => 1
[phone_number] => 9080809
[email] => [email protected]
[appointments_enabled] => 0
[role_in_saloon] => Owner
[name] => mubassir
)
)
Any Help Will be Appreciated.