Hello Man
Hello Man

Reputation: 701

Unidentified Unexpected T_Variable error

I am not sure why i get this error, i find everything right. Can anyone help me out?

if (str_replace('\', ' / ',$_SERVER['DOCUMENT_ROOT']) == SERVER_ROOT) { define('ABS_PATH', '');}
else { define('ABS_PATH', SERVER_ROOT); }

What am i missing in this?

Upvotes: 0

Views: 43

Answers (1)

fijas
fijas

Reputation: 1274

if (str_replace('\\', ' / ',$_SERVER['DOCUMENT_ROOT']) == SERVER_ROOT){ 
    define('ABS_PATH', '');
} 
else { 
    define('ABS_PATH', SERVER_ROOT); 
} 

The \ is escaping the following quotation. Try changing that to '\\' as shown...

Upvotes: 1

Related Questions