Location: PHPKode > projects > PHPCrawl > PHPCrawl_080/documentation/classreferences/PHPCrawler/method_detail_tpl_method_addURLFollowRule.htm


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
 <title>Method Details</title>
 <link rel="stylesheet" type="text/css" media="screen" href="style.css">
 
 <script name="javascript">
 
 function show_hide_examples(mode)
 {
   if (document.getElementById("examples").style.display == "none")
   {
     document.getElementById("examples").style.display = "";
   }
   else
   {
     document.getElementById("examples").style.display = "none";
   }
 }
 </script>
 
</head>

<body>

<div id="outer">

<h1 id="head">
  <span>Method: 
PHPCrawler::addURLFollowRule()</span>
</h1>

<h2 id="head">
 <span><a href="overview.html"><< Back to class-overview</a></span>
</h2>

<br>




<div id="section">

Adds a rule to the list of rules that decide which URLs found on a page should be followd explicitly.
</div>

<div id="section">
<b>Signature:</b>
<p id="signature">
  
public addURLFollowRule($regex)
</p>
</div>

<div id="section">
<b>Parameters:</b>
<p>
<table id="param_list">
  
<tr><td id="paramname" width="1%"><b>$regex</b>&nbsp;</td><td width="1%"><i><i>string</i></i>&nbsp;</td><td width="*">Regular-expression defining the rule</td></tr>
</table>
</p>
</div>

<div id="section">
<b>Returns:</b>
<p>
<table id="param_list">
  
<tr> <td width="1%"><i><i>bool</i></i>&nbsp;</td> <td width="*"> TRUE if the regex is valid and the rule was added to the list, otherwise FALSE.</td></tr>
</table>
</p>
</div>

<div id="section">
<b>Description:</b>
<p>

  
If the crawler finds an URL and this URL doesn't match with any of the given regular-expressions, the crawler<br>will ignore this URL and won't follow it.<br><br>NOTE: By default and if no rule was added to this list, the crawler will NOT filter ANY URLs, every URL the crawler finds<br>will be followed (except the ones "excluded" by other options of course).<br><br>Example:<code>$crawler-&gt;addURLFollowRule("#(htm|html)$# i");<br>$crawler-&gt;addURLFollowRule("#(php|php3|php4|php5)$# i");</code><br>These rules let the crawler ONLY follow URLs/links that end with "html", "htm", "php", "php3" etc.
  
</p>
</div>





</div>


<div id="footer">Docs created with <a href="http://phpclassview.cuab.de"  target="_parent">PhpClassView</a></div>
  
</body>
</html>
Return current item: PHPCrawl