Search
 
SCRIPT & CODE EXAMPLE
 

PHP

count same datetimes in foreach and group them php

$matchs = DiraChatLog::where('status','=','Match')->whereBetween('date_access', [$request->from, $request->to])->get();
$array[] = [];
foreach ($matchs as $key => $match) {
 $day = substr($match->date_access, 0, 10);
 if(isset($array[$day])){
  $array[$day]++;
 }else{
  $array[$day] = 1;
 }
}

dd($array);
Comment

PREVIOUS NEXT
Code Example
Php :: how to auto calculate price in mysql table and php 
Php :: run php code online 
Php :: button onclick php 
Php :: woocommerce subscriptions custom user rolde 
Php :: cors laravel 
Php :: !array_push($stack, "apple", "raspberry"); 
Php :: debugger not installed phpstorm 
Php :: simple pyramid pattern 
Php :: laravel first or with callback 
Php :: test lockForUpdate laravel 
Php :: laravel illuminate filesystem not found 
Php :: php square root 
Php :: back to same page after changing locale 
Php :: add attachment to the invoice laravel 
Php :: Set Countries To Appear At The Top Of The Caldera Forms Phone Field List 
Php :: ring create an RSA key from PEM encoded string 
Php :: reset internal pointer mysql query 
Php :: list bulan php 
Php :: get pages with tempalte wp 
Php :: laravel ignition dark mode 
Php :: wp varnish ip 
Php :: infoplist codepush key 
Php :: select query with multiple where clause in php 
Php :: Add Payment Type to WooCommerce Admin Email 
Php :: find common value from sub arrays 
Php :: mkdir recursive php 
Php :: Laravel A row must be an array or a TableSeparator instance. 
Php :: php execute powershell script with parameters 
Php :: Jaygaah Free Shipping Woocommerce 
Php :: Generating Random String In PHP Using Hashing Functions 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =