$song = "They Might Be Giants - No!.mp3"
$arr = explode(' - ', $song);
$length = strlen($arr); // gets char length of song
$artist = $arr;
$song = substr($arr, 0, ($length-4); // deletes the .mp3 off of song name
He who is devoid of the power to forgive is devoid of the power to love. -
Dr. Martin Luther King, Jr.
> From: Antti <[EMAIL PROTECTED]>
> Date: Thu, 12 Dec 2002 17:49:14 +0200
> To: [EMAIL PROTECTED]
> Subject: [PHP] take text before '-' and after it
> 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.
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php