I’m getting an error with the following code:
public $arr = array('email' => 'admin@' . str_replace('http://', '', SERVER_ROOT));
Parse error: syntax error, unexpected '.', expecting ')'
Am I being really stupid? Surely I can concatenate strings here?
This is a variable declared in a class.
You cannot initialize class attributes with an expression. You have to do that in the constructor or use a fixed value, like a regular string.