title: Spilt array values into separate variables
body: <p>I'm trying to read my data from a txt file line by line, and if the line matches $PageName stop and spit that string into variable's I'm a nube and cant figure it out. Here is were I'm at with my code.</p>
  <pre><code>$PageName = &quot;Home&quot;;
  $SiteAttributes = file(&quot;SiteAttributes.dat&quot;);
  
  foreach($SiteAttributes as $line){
      $str_arr = preg_split (&quot;/\|/&quot;, $line,);
      echo&quot;$PageName $line&lt;br&gt;&quot;;
      if($PageName == $line[0]){
          echo&quot;$PageName $line&quot;;
          last;
      }   
  }
  </code></pre>
  <p><strong>SiteAttributes.dat looks like this:</strong></p>
  <pre><code>Amenities||||||
  FloorPlans||||||
  Home||This is the updatede title|this it the new Keywords|this it the new Desription|&lt;script src=&quot;code/system/library/bx-slider/js/jquery-3.1.1-min.js&quot;&gt;,&lt;/script&gt;&lt;script src=&quot;code/system/library/bx-slider/js/jquery.bxslider.js&quot;&gt;&lt;/script&gt;,&lt;link href=&quot;code/system/library/bx-slider/css/jquery.bxslider.css&quot; rel=&quot;stylesheet&quot;&gt;|
  LocalMap|||||| 
  </code></pre>