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.

Community
  • 1
  • 1
user905080
  • 15
  • 2

1 Answers1

1

You can simply do this

$accessedarray[$source] = $finished;
Dogbert
  • 212,659
  • 41
  • 396
  • 397