1

Possible Duplicate:
Array push with associate array

I am trying to design a php program to crawl a website and recursively follow all links until the entire website is searched. To accomplish this, I am trying to use a multidimensional array, with the key set to the website eg. "www.coca-cola.com" and the values set to all of the links on that page (www.coca-cola.com/buy, www.coca-cola.com/find a product/, etc). I plan to access each of those sublinks recursively until they are all searched. However, I am running into a problem with this line of code:

array_push($accessedarray, ($source => $finished)); 

This doesn't seem to work. Does anyone know of a better method for accomplishing this task?

Thanks.

0

1 Answer 1

1

You can simply do this

$accessedarray[$source] = $finished;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.