PregMach with php GET method
<p>I have a page test.php in which I have a list of names:</p>

<pre><code>name1='992345'
name2='332345'
name3='558645'
name4='434544'
</code></pre>

<p>In another page <code>test1.php?id=name2</code> and the result should be:</p>

<blockquote>
  <p>332345</p>
</blockquote>

<p>I've tried this PHP code:</p>

<pre><code>&lt;?php 
$Text=file_get_contents("test.php")
$id = $_GET["id"];
;preg_match_all('/$id.=\'([^\']+)\'/',$Text,$Match); 
$fid=$Match[1][0]; 
echo $fid; ?&gt;
</code></pre>

<p>if the code is used like this</p>

<pre><code>&lt;?php 
    $Text=file_get_contents("test.php")
    ;preg_match_all('/name3=\'([^\']+)\'/',$Text,$Match); 
    $fid=$Match[1][0]; 
    echo $fid; ?&gt;
</code></pre>

<p>the result is good </p>

<blockquote>
  <p>558645</p>
</blockquote>

<p>But i wanto be able to change the name of <code>'/name3=\'</code> from <code>;preg_match_all('/name3=\'([^\']+)\'/',$Text,$Match)</code> with GET method like this if <code>test1.php?id=name4</code> the result wil bee <code>434544</code>.</p>
