0

I have one echo join that prints the values ​​of an array. But i need this echo join prints the first array + the second array.

Example: array1: 1,2,3 array2: a,b,c

Result: 1a,2b,3b etc..

I have a cicle while that analyzes all the records in a table and places them in the two arrays . How can I do to ensure that the echo join molds both the array? Thanks to all!

5
  • 1
    You need to add the code you currently have and what you've tried. Commented Jan 26, 2015 at 17:32
  • Writing some code would be a good start. Commented Jan 26, 2015 at 17:33
  • Please improve your Quest.. Commented Jan 26, 2015 at 17:35
  • 1
    Loop over one array, and use the index to get values from both. Commented Jan 26, 2015 at 17:41
  • I was thinking of array_combine and worked out the answer, but then I see that your first array is not symmetrical to the second. You can't tell which value of the first array belongs to the one in the second. So more information is needed that will give you that link. Commented Jan 26, 2015 at 17:49

1 Answer 1

2

Why don't you try to mix those arrays in one associative array like:

array('A' => 1, 'B' => 2);

Then you do a foreach and print the key and the value.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.