PHP array print statement
<p>Here is my code:</p>

<pre><code>        if(is_file($userName.".txt")) {
            $userDetails = explode(',', file_get_contents($userName.".txt"));
            print($userDetails[0]);
            if ($password == $userDetails[0]) {
                print('Correct login');
            } else {
                print('Incorrect login');
            }
        }
</code></pre>

<p>And I have the following file: Simon.txt with the following contents: simonpassword,4,1
If the $userName is 'Simon', when the code is run, how come 4 is printed out instead of simonpassword at the line: print($userDetails[0])?</p>
