We help IT Professionals succeed at work.

Create an array from java code output in PHP

NGTLD
NGTLD asked
on
329 Views
Last Modified: 2013-12-13
I have a java applet that returns a bunch of records in a string i.e.
$results[0][0]
$results[0][1]
$results[1][0]
$results[1][1]

I am lost, I can display this if I hard code echo $results[0][1] and so on, but how can I create an array that I could then do while loop with like I would with mysql. If there is a better way than that then please advise. I thought about looping through the first numeric value, but do not know how to check for the last number.
Comment
Watch Question

I would have the java output a single String, each array element to be seperated by commas. Then with PHP use theexplode method. To split the String back into an array.

Author

Commented:
That would be great, but I cannot change the java.
CERTIFIED EXPERT
Top Expert 2016

Commented:
I'm confused. Is this a Java or php question? Returns to where and how?

Author

Commented:
It is a PHP question.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
can't you just use two for loops too loop through the array

Author

Commented:
I am asking the wrong question. Sorry guys. I have a two dimensional array I need to implode. I am trying to figure that out now.
Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, I saw that as well. It did not work, but the one a few post up did work.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.