title: How to sort the contents of a textfile that is converted into an array by the second or third element using PHP
body: <p>I have a text file called base.txt with the following contents (using : as the delimiter to separate the form data):</p>
  
  <pre><code>jon:doe:fakeemail@mail.com:fakepassword
  bob:cosper:bob2@mail.com:fakepass
  </code></pre>
  
  <p>In the php file I made that into an array by doing:</p>
  
  <pre><code>$data = file('base.txt');
  </code></pre>
  
  <p>Now if I want to print the contents and sort it by the first name I just do<code>sort($data);</code> 
  but what can I do if I wanted to sort it by the last names or the emails?</p>