FareedR
2 months ago
613
2
Laravel

Intersect value in array

Posted 2 months ago by FareedR

How can i merge if the value is same

// controller 
foreach($stocks as $stock){
            $signals[] = explode('+',$stock->signal);
            $time_frames[] = explode(',',$stock->time_frame);
        }
return view('stocks.custom',compact('stocks','signals','time_frames'));

//database 

id | timeframe | signal |
1      300,300,3     PLT+SLT+TNT

// expected result in blade
300 : 3
PLT   TNT
+
SLT

// current result in blade
300 : 300 : 3
PLT   SLT    TNT

Please sign in or create an account to participate in this conversation.