php - Read first half of file contents and echo and then the second half -


i have text file lists name of track after double space artist listed. in order me fetch album art last.fm have have both title , artist in the url http://ws.audioscrobbler.com/2.0/?method=track.getinfo&track=track title&artist=artist. since artist , track title aren't in separate files, there way can part before double space , call $title , part after double space , call $artist, can echo url?

this have file contents:

<?php $current = file_get_contents('rbds%20text.txt'); echo $current; ?> 

thanks!

edit:

so text file outputs "track title [double space] artist"

for last.fm have have in url track=track title&artist=artist

if understand well, want this:

list($title, $track) = explode('  ', trim(file_get_contents('rbds%20text.txt')), 2); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -