1

I have one simple question. How to push a value to the array in every step of recursion? I have a small script that gets content of 10 - 20 urls, gets the image url and it should everytime push the found image url to the array. How to do it?

1
  • You will have to show some code. Commented Dec 2, 2011 at 12:57

2 Answers 2

4
$yourArray[] = $newElement;

This will push $newElement to the end of your array.

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

1 Comment

No, I mean something like this - I have 10 pages. On every page I have link to other of these pages (first page contains link to the second, second to the third and so on...) - pastebin.com/hTs6m7SL
0

Solved by rewriting the function to iteration instead of recursion.

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.