0

Just started learning PHP out of curiosity. Currently going through all basic fundamentals in PHP and that's when I came across this function define that we do use to define variables with constant values. However, instead of showing me an expected output, it's giving me unexpected result. Can anybody help me?

define('HOST', 'localhost');   // syntax error, unexpected identifier "define", expecting "," or ";"
define('USER', 'root');
tink
  • 14,342
  • 4
  • 46
  • 50

1 Answers1

1

With the limited information given in this post, i only see two point where the issue might hide.

  1. You forgot to start your php code with a <?php start tag
  2. You have some php code above the snippet you posted that is missing it's ;(semicolon) on the end of it's line. Good hunting :-)

Hope this helps :-)

Sicet7
  • 127
  • 4