title: Search multidimensional array for value in certain key, return value of different key
body: <p>I'm new to php and have been using the community and answers here to really help me with a little project I'm working on so thank you all in advance for the help so far! </p>
  
  <p>I am pulling a load of information held in a poorly formatted text file/feed, trimming the contents of special characters and then using <code>str_replace</code> to find other specific strings and replace them with commas(,) or semi-colons(;), in order to create a usable piece of text. I then want to search this text for certain keywords and return other parts of the text in it's place. </p>
  
  <p>So far, I've managed to explode the text into a multidimensional array, but I can't work out how to search this array now, in order to pull out a specific piece of information. I'm essentially trying to build a searchable array that I can pull information from as and when the original feed updates. Here's a sample of the array as it stands at the moment:</p>
  
  <pre><code>Array
  (
   [0] =&gt; Array
      (
          [0] =&gt; 240
          [1] =&gt; 1
          [2] =&gt; euro
          [3] =&gt; 2016-02-19 15:30:00
          [4] =&gt; EUR
      )
  
   [1] =&gt; Array
      (
          [0] =&gt; 240
          [1] =&gt; 3
          [2] =&gt; euro2
          [3] =&gt; 2016-02-19 15:00:00
          [4] =&gt; EUR
      )
  
   [2] =&gt; Array
      (
          [0] =&gt; 1890
          [1] =&gt; 9
          [2] =&gt; uspb
          [3] =&gt; 2016-02-17 22:59:00
          [4] =&gt; USD
      )
  )
  </code></pre>
  
  <p>Essentially, I want to be able to write something that will search this array for say <code>uspb</code> <strong>(array 2, key 2)</strong> and if it is found, return the value held under another key. So if I want key 0, it will return <code>1890</code>. If I want key 1 when searching for <code>euro2</code> it will return "3". </p>
  
  <p>I've looked through a ton of examples and nothing really fits what I'm after at the moment. Perhaps I'm looking at this the wrong way and using an array isn't the correct approach. Any advice would be greatly appreciated. </p>
  
  <p>For reference, here's a copy of my code (slight redacted) so far.</p>
  
  <pre><code>&lt;?php 
      $file=file_get_contents("http://www.example.com/feed/");
      $trim=trim($file, "[]");
      $find = array("{\"value\":\"", "\",\"date_utc\":\"", "\",\"currency\":\"");
      $replace = array(",", ",", "");
      $replaced = str_replace($find, $replace, $trim);
  
  $ret = array_map (
    function ($_) {return explode (',', $_);},
    explode (';', $replaced)
  );
  
  print_r ($ret);
      ?&gt;
  </code></pre>