PHP获取JSON变量并添加前缀

时间:2016-05-07 15:41:51

标签: php arrays json loops

我需要遍历一些JSON并获取Ids

这是我的JSON

{"Master":123456,"Ids":[1,3,8]}

我需要获取所有Ids并添加前缀.pre-,所以我最终在PHP中使用它:

$Ids =  ".pre-1, .pre-3, .pre-8"

非常感谢任何帮助。我确实浏览了其他帖子并尝试了一些事情,但我无法做到。

由于

1 个答案:

答案 0 :(得分:1)

做这些:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hive/service/cli/thrift/TCLIService$Iface
    at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107)
    at java.sql.DriverManager.getConnection(DriverManager.java:571)
    at java.sql.DriverManager.getConnection(DriverManager.java:215)
    at HiveConnector.HiveConnect.<init>(HiveConnect.java:27)
    at HiveConnector.HiveConnect.main(HiveConnect.java:42)
Caused by: java.lang.ClassNotFoundException: org.apache.hive.service.cli.thrift.TCLIService$Iface
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 5 more
    at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107)
Java Result: 1