Location: PHPKode > scripts > preg_magic > preg_magic/doc/preg_magic/preg_magic.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class preg_magic</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			

<h2 class="class-name">Class preg_magic</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">preg_magic</p>
<p class="description"><p>Class of static functions containing preg_magic</p><p>You should call the <a href="../preg_magic/_preg_magic.php.html#functionpreg_magic">preg_magic()</a> function to do all your hard work as  the class is pretty much just used as a namespace</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Shannon Wynter &lt;<a href="mailto:http://fremnet.net/contact">http://fremnet.net/contact</a>&gt;</li>
				<li><span class="field">version:</span> 1.0</li>
				<li><span class="field">copyright:</span> Copyright Shannon Wynter &amp; Fremnet.net</li>
				<li><span class="field">see:</span> <a href="../preg_magic/_preg_magic.php.html#functionpreg_magic">preg_magic()</a></li>
				<li><span class="field">license:</span> <a href="http://opensource.org/licenses/gpl-license.php">GNU Public License</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_preg_magic.php.html">/preg_magic.php</a> (line <span class="field">93</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
												<div class="method-definition">
					static 						<span class="method-result">array|false</span>
										<a href="#associate" title="details" class="method-name">associate</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$Fields</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$Data</span>)
									</div>
																<div class="method-definition">
					static 						<span class="method-result">string</span>
										<a href="#build_expr" title="details" class="method-name">build_expr</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$Fields</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$Depth</span> = <span class="var-default">0</span>])
									</div>
																<div class="method-definition">
					static 						<span class="method-result">string</span>
										<a href="#escape_open_bracket" title="details" class="method-name">escape_open_bracket</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$Regex</span>)
									</div>
																<div class="method-definition">
					static 						<span class="method-result">array|false</span>
										<a href="#execute" title="details" class="method-name">execute</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$Fields</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$Target</span>)
									</div>
								
																																				</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodassociate" id="associate"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method associate</span> (line <span class="line-number">152</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">associate</p>
<p class="description"><p>Performs a similar duty to <a href="http://www.php.net/array_combine">array_combine</a>  with the exception that this is capable of checking for tables so recursive field  definitions can function.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> An associative array of $Fields to $Data or false on failure</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">array|false</span>
		<span class="method-name">
			associate
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$Fields</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$Data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$Fields</span><span class="var-description">: The fields passed to <a href="../preg_magic/preg_magic.html#methodexecute">execute()</a></span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$Data</span><span class="var-description">: The array of matches from <a href="http://www.php.net/preg_match">preg_match</a></span>			</li>
				</ul>
		
			
	</div>
<a name="methodbuild_expr" id="build_expr"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method build_expr</span> (line <span class="line-number">188</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">build_expr</p>
<p class="description"><p>Builds as much of the expression as required to make the closest match possible  based on the $Fields provided to <a href="../preg_magic/preg_magic.html#methodexecute">execute()</a>.</p><p>Automatically escapes submatches if there is recursion</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The combined regular expression</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">string</span>
		<span class="method-name">
			build_expr
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$Fields</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$Depth</span> = <span class="var-default">0</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$Fields</span><span class="var-description">: The fields passed to <a href="../preg_magic/preg_magic.html#methodexecute">execute()</a></span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$Depth</span><span class="var-description">: Reserved - Do not use this unless you know what you are doing</span>			</li>
				</ul>
		
			
	</div>
<a name="methodescape_open_bracket" id="escape_open_bracket"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method escape_open_bracket</span> (line <span class="line-number">220</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">escape_open_bracket</p>
<p class="description"><p>Ugly little function to escape ( to (?: for deep expressions</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">string</span>
		<span class="method-name">
			escape_open_bracket
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$Regex</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$Regex</span>			</li>
				</ul>
		
			
	</div>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method execute</span> (line <span class="line-number">106</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">execute</p>
<p class="description"><p>Performs the preg_match.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> An associative array containing data, or false on failure to match</li>
				<li><span class="field">see:</span> <a href="../preg_magic/_preg_magic.php.html#functionpreg_magic">preg_magic()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">array|false</span>
		<span class="method-name">
			execute
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$Fields</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$Target</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$Fields</span><span class="var-description">: An associative array of fields to be use</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$Target</span><span class="var-description">: The target string to process</span>			</li>
				</ul>
		
			
	</div>

						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Tue, 05 Feb 2008 22:29:20 +1100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>
Return current item: preg_magic