這是一個奇怪的問題。這裏是我的代碼將Java字符串轉換爲數組
String reply = listen.executeUrl("http://localhost:8080/JavaBridge/reply.php);
executeUrl返回字符串對象無論由reply.php文件返回什麼。 現在出現這個問題。在reply.php中,我返回一個PHP數組,並且答覆是一個String。
當我做
System.out.println("Reply = "+reply);
我得到
Reply = array(2) { [0]=> string(14) "Dushyant Arora" [1]=> string(19
) "@dushyantarora13 hi"}
但答覆仍然是一個字符串。我如何將其轉換爲字符串數組或數組。
我需要在Java端陣列。我如何獲得? – Bruce 2010-06-08 14:48:48
忘記了,就像thetaiko說JSON是你需要的:) – 2010-06-08 14:56:00