title: Using cURL to get all links in a website (not only the page)
body: <p>I use the following PHP script to get all the links on a given page, but I'm trying to get all the links on a website as a whole.</p>
  
  <pre><code>&lt;?php
  
      function urlLooper($url){
  
          $urlArray = array();
  
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
          $result = curl_exec($ch);
  
          $regex='|&lt;a.*?href="(.*?)"|';
          preg_match_all($regex,$result,$parts);
          $links=$parts[1];
          foreach($links as $link){
              array_push($urlArray, $link);
          }
          curl_close($ch);
  
          foreach($urlArray as $value){
              echo $value . '&lt;br /&gt;';
          }
      }
  
      $url = 'http://www.justfundraising.com/';
      urlLooper($url);
  </code></pre>
  
  <p>?></p>
  
  <p>Is there any way to use cURL (or any other method frankly) to get all the links on a website? I have access to the server in case you're wondering.</p>
  
  <p>My idea was to generate all the links from, say, the homepage and then pass those links back through the same function to get a new list of links ignoring any duplicates. I figure that way I'll get all the pages.</p>
  
  <p>Any help will be appreciated!</p>