 <p>Use the <code>file()</code> function in PHP to split each line of the file into an array then set each element of the array equal to it's respective variable. For example:</p> <pre><code>$lines = file('user1.txt'); $firstname = $lines[0]; $lname = $lines[1]; $age = $lines[2]; $gender = $lines[3]; </code></pre>