Use of undefined constant

前端 未结 2 1415
生来不讨喜
生来不讨喜 2021-01-29 16:01

Hi I have this error in my website my website is wordpress 4 i use post format in post format i create this php to if page has quote post then dont load title and image and etc

相关标签:
2条回答
  • 2021-01-29 16:18

    verify that all variables have this sign $

    correct variable $test

    incorrect variable test

    0 讨论(0)
  • 2021-01-29 16:32

    If you want to use the quote as a literal string (line 4), not a variable name, you must enclose it into single or double quote characters (' or "). Otherwise, PHP thinks that you're referencing a PHP constant.

    For reasons of backward compatibility, PHP falls back on using the string as literal, but it does throw an E_NOTICE error – the one you're experiencing.

    0 讨论(0)
提交回复
热议问题