Read first half of file contents and echo and then the second half
<p>I have a text file that lists the name of a track then after a double space the artist is listed. In order for me to fetch the album art from Last.fm I have to have both the title and artist in the the URL like <code>http://ws.audioscrobbler.com/2.0/?method=track.getinfo&amp;track=TRACK TITLE&amp;artist=ARTIST</code>. Since the artist and track title aren't in separate files, is there a way I can get the part before the double space and call it $title and the part after the double space and call it $artist, so I can just echo it into the URL?</p>

<p>This is what I currently have to get the file contents:</p>

<pre><code>&lt;?php
$current = file_get_contents('RBDS%20Text.txt');
echo $current;
?&gt;
</code></pre>

<p>Thanks!</p>

<p>EDIT:</p>

<p>So the text file outputs the "track title [double space] artist"</p>

<p>For Last.FM I have to have in the URL <code>track=TRACK TITLE&amp;artist=ARTIST</code></p>
