Re: take text before '-' and after it
| From: | Richard Baskett | Date: | Thu, 12 Dec 2002 16:05:24 +0000 |
| Subject: | Re: take text before '-' and after it | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128028@lists.php.net to get a copy of this message | ||
$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 <antti@victoria.fi>
> Date: Thu, 12 Dec 2002 17:49:14 +0200
> To: php-general@lists.php.net
> 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
>
>
>