title: PHP - strpos on array elements?
body: <p>For some reason I can't get strpos to work to search my array, even if <code>$jobList[1]</code> and <code>$titlesearch</code> are the same values... Sorry if it's something obvious but I'm still pretty new to coding!</p>
  
  <p>I begin with my <code>$data</code> array which looks like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; P0001    Lifeguard   descexample 18/09/18    parttime    fixedterm       mail    vic
  
      [2] =&gt; P0002    IT Manager  descexample 18/09/18    fulltime    ongoing post    mail    sa
  
  )
  </code></pre>
  
  <p>I then explode each of these entries into their own array...</p>
  
  <pre><code>for ($i = 0; $i &lt; count($data); $i++) {
      $jobList = explode("\t", $data[$i]);
  }
  
  Array
  (
      [0] =&gt; P0001
      [1] =&gt; Lifeguard
      [2] =&gt; descexample  
      [3] =&gt; 18/09/18
      [4] =&gt; parttime
      [5] =&gt; fixedterm
      [6] =&gt; 
      [7] =&gt; mail
      [8] =&gt; vic
  
  )
  Array
  (
      [0] =&gt; P0002
      [1] =&gt; IT Manager
      [2] =&gt; descexample  
      [3] =&gt; 18/09/18
      [4] =&gt; fulltime
      [5] =&gt; ongoing
      [6] =&gt; post
      [7] =&gt; mail
      [8] =&gt; sa
  
  )
  </code></pre>
  
  <p>Now I'm trying to search through these arrays from a user input, <code>$titlesearch</code>, and find it's matches with the job titles, <code>$jobList[1]</code>:</p>
  
  <pre><code>if (strpos($jobList[1], $titlesearch)) {
          echo "nice one";
      }
  </code></pre>
  
  <p>No matter what loops I try, the <code>strpos</code> never returns true, even if I echo the values and they both give the same result, so I'm really not sure what I'm doing wrong :'(</p>
  
  <p>Any help is greatly appreciated!</p>