how to store value in array & then it use in other?
<p>i am performing search condition of image file &amp; using <code>print_r()</code> it shows output of image path in array. now i want to store this array &amp; perform search operation for particular image path in that stored array.
this is code of searching image file:</p>

<blockquote>
  <p>$root1 = $_SERVER['DOCUMENT_ROOT']; </p>
  
  <p>$directory = $root1.'/Place4Info/Data/Admin_data/';</p>
  
  <p>$it = new
  RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
  $i=0;
  $num=1;
  while($it->valid() and $iisDot()) {
          $files = glob($directory.$it->getSubPath().'/*.jpg');
          print_r($files);</p>
  
  <p>$i++;
      }
    $it->next(); }</p>
</blockquote>

<p>&amp; output is:</p>

<blockquote>
  <p>Array ( [0] => C:/Program
  Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports19.jpg
  [1] => C:/Program
  Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports21.jpg
  [2] => C:/Program
  Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports22.jpg
  [3] => C:/Program
  Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports3.jpg
  )</p>
</blockquote>

<p>now i want store this output in a variable or in array.
after that i want to perform search action on that variable or array, like find the path of <code>"C:/Program Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports22.jpg "</code> file. &amp; store that result in variable. 
i got one code but i dont know how to apply this.</p>

<blockquote>
  <p>$conditions = array("Post.title&lt;>" =>
  $files);
          $this->Post->find('sports3.jpg',
  array('conditions' => $conditions));
        echo $this;</p>
</blockquote>

<p>but it give error:</p>

<pre><code>Fatal error: Using $this when not in object context in C:\Temp\test.php on line 17
</code></pre>
