syntax error, unexpected T

I have this line in PHP:

if (( array_key_exists( $from, $arrRates ) && array_key_exists( $to, $arrRates ) )) {
        return $amount + ( $arrRates[$to]  $arrRates[$from] );
    }

When I run it, I get the error:

Parse error: syntax error, unexpected T_NS_SEPARATOR in C:xampphtdocsMediaAlbumWebUtilsUtils.php on line 218

What is the T_NS_SEPARATOR and why is it unexpected?


Use / instead of .

The T_NS_SEPARATOR ( ) is mainly used for escaping, what you are looking for is the token for division which is / :

if (( array_key_exists( $from, $arrRates ) && array_key_exists( $to, $arrRates ) )) {
    return $amount + ( $arrRates[$to] / $arrRates[$from] );
}
链接地址: http://www.djcxy.com/p/69468.html

上一篇: 解析错误:语法错误,意外的'*'

下一篇: 语法错误,意外的T