Possible Duplicate:
Parse error: syntax error, unexpected ‘.’, expecting ‘,’ or ‘;’
I have this class:
<?php
class MyClass {
const DB_NAME = "MyDb";
const HOST = "localhost";
const USER = "abcdef";
const PASSWORD = "ghijklmn";
public static $MyString = file_get_contents('file.txt');
}
?>
I have no idea what is wrong with file_get_contents
?
I cannot understand what is the error says ? Why (
is unexpected ?
I read the following articles but these don't help me to solve that error:
Parse error: syntax error, unexpected T_STRING in php
file_get_contents shows unexpected output while reading a file