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
  • 4,115
  • 2
  • 22
  • 41

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;