0

This line is causing my log files to fill with Undefined Index

$calculated[$tag_id] > 0 ? $calculated[$tag_id] = $calculated[$tag_id]+1 : $calculated[$tag_id] = 1;

Any help would be highly appreciated.

Avinash
  • 3,744
  • 2
  • 19
  • 40

1 Answers1

0

Maybe make the ternary operation equal to a variable , instead of setting the array key in the operation

$calculated[$tag_id] = ($calculated[$tag_id] > 0) ? $calculated[$tag_id] + 1 : 1;