$song = "They Might Be Giants - No!.mp3"

$arr = explode(' - ', $song);
$length = strlen($arr[1]); // gets char length of song

$artist = $arr[0];
$song = substr($arr[1], 0, ($length-4); // deletes the .mp3 off of song name

Cheers!

Rick

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.
> 
> antti
> 
> 
> -- 
> 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

Reply via email to