Re: take text before '-' and after it
| From: | Justin French | Date: | Fri, 13 Dec 2002 02:09:46 +0000 |
| Subject: | Re: take text before '-' and after it | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128106@lists.php.net to get a copy of this message | ||
Hi,
<?
$file = "Some Artist - Some Song.mp3";
list($artist,$song) = explode('-',$file);
$artist = trim($artist);
$song = trim(str_replace('.mp3','',$song));
?>
Then you can do whatever you want with them... but I can't see why you'd
write them to a disk file AND write them to a mysql database -- wouldn't it
be one or the other?
on 13/12/02 2:49 AM, Antti (antti@victoria.fi) wrote:
> How can I take some text before the mark - and after it and put them for
> example in array. The purpose of this is to read trough mp3 files which
> are in the form of artist - song.mp3 and put them into a text file so I
> can put them into mysql db.
>
> antti
>
Justin French
--------------------
http://Indent.com.au
Web Development &
Graphic Design
--------------------