【发布时间】:2017-09-01 19:38:51
【问题描述】:
我正在尝试使用 Skyscanner JsonPath 实现(参考 https://github.com/Skyscanner/JsonPath-PHP)。
按照他们的指示,我尝试以这种方式制作一个小的 PHP 示例(名为 testSkyScanner.php)(我使用的是 Ubuntu 15.10 ....)
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
use JsonPath/JsonObject
$theJson = '{
"codiciColore": [{
"id": 2,
"descrizione": "Giallo",
"rgb": "FFFF00",
"priorita": 2,
"situazionePazienti": {
"numeroPazienti": 9,
"numeroPazientiInVisita": 9,
"mediaAttesa": "00:22",
"numeroPazientiInAttesa": 0
}
}, {
"id": 3,
"descrizione": "Verde",
"rgb": "00FF00",
"priorita": 3,
"situazionePazienti": {
"numeroPazienti": 16,
"numeroPazientiInVisita": 9,
"mediaAttesa": "03:03",
"numeroPazientiInAttesa": 7
}
}]
}';
$jsonObject = new JsonObject();
?>
我已经以这种方式组织了我的代码......
当我尝试使用php testSkyScanner.php 执行它时,我收到此错误...
PHP Warning: The use statement with non-compound name 'JsonPath' has no effect in /var/www/html//Test/tmp/MyTestSkyScanner/testSkyScanner.php on line 7
PHP Parse error: syntax error, unexpected '/', expecting ',' or ';' in /var/www/html/Test/tmp/MyTestSkyScanner/testSkyScanner.php on line 7
建议?提前致谢!
【问题讨论】: