这个问题在这里已有答案:
我在PHP中集成了一个支付网关,但由于版本兼容性,我得到了这个错误。我的网站上有php v = 5.2.17。我想使用'\',这是抛出错误。因为它在版本> 5.4中受支持。
如果不更改版本,我该怎么办,因为更改版本会在我的网站上带来许多错误。
我可以在不将PHP版本从5.2.17更改为> 5.4的情况下删除此错误吗?
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in D:\INETPUB\VHOSTS\veronica-64.com\instamojo\pay.php on line 15
Parse error: syntax error, unexpected T_STRING in D:\INETPUB\VHOSTS\veronica-64\instamojo\pay.php on line 15
错误是由于下面一行的'\'。
$api = new Instamojo\Instamojo('test_xxxxxxxxxxxxxxxxxxxxxxx', 'test_xxxxxxxxxxxxxxxxxxx','https://test.instamojo.com/api/1.1/');
api key和auth token不应该放在引号中,正确的形式如下。
$api = new Instamojo\Instamojo(test_xxxxxxxxxxxxxxxxxxxxxxx, test_xxxxxxxxxxxxxxxxxxx, 'https://test.instamojo.com/api/1.1/');