It isn't an error, just a "Notice"
It's really $total_pages['num'] (Note, "num" is a String)
In php, you can definite constants
Variables are prefixed with the $, but constants have no prefix.
Fortunately, php is smart enough to realize that in $total_pages[num], since you have no constant named num, you must mean the string 'num'.
Bruce