set php variable to find current page
<pre><code>$pages = array('Text1.php', 'Text2.php', 'Text3.php');

// $currentpage depends the page you're on

$currentId = array_search($currentpage, $pages);
</code></pre>

<p>I have php script which is accessed through an <code>include(Text4.php)</code> and the <code>include(Text4.php)</code> is stored in all the three php scripts above in the array.
 Now what I want to do is set up the <code>£currentpage</code> so that it should equal the page the user is currently on and match a value in <code>$pages</code> which should be the filename of the current page.</p>

<p>My question is that in the code above, how should $currentId variable be written to perform the functionality it is suppose to acheive?</p>
