I hope someone can help me, Im going crazy trying to find out why I am getting the error
Parse error: syntax error, unexpected T_NS_SEPARATOR in the script below. The error is happening on this line in the below script [php]return substr( $_SERVER[$key], 0, @strrpos( $_SERVER[$key], ‘\’ ) );[/php]
any help would be appreciated
[php] function path_translated() {
$option = array( ‘PATH_TRANSLATED’, ‘ORIG_PATH_TRANSLATED’, ‘SCRIPT_FILENAME’, ‘DOCUMENT_ROOT’, ‘APPL_PHYSICAL_PATH’ );
foreach ($option as $key) {
if (( !isset( $_SERVER[$key] ) || strlen( trim( $_SERVER[$key] ) ) <= 0 )) {
continue;
}
if (( @substr( @php_uname( ), 0, 7 ) == 'Windows' && strpos( $_SERVER[$key], '\\' ) )) {
return substr( $_SERVER[$key], 0, @strrpos( $_SERVER[$key], '\\' ) );
}
return substr( $_SERVER[$key], 0, @strrpos( $_SERVER[$key], '/' ) );
}
return 'Directory path could be determined.';
}[/php]