August 17th, 2000, 05:24 PM
-
I would like to know how i could seperate something, so instead of having one big thing i have to smaller things... example: take a song "Our Lady Peace - Thief" and turn it into 2 things, like:
$artist = Our Lady Peace;
$song = Thief;
Is this task easily accomplished? If so can anyone show me?
Thanks,
Scott
August 17th, 2000, 10:34 PM
-
Scott,
you can use explode() or split() function to seperate the values.
here is an example using explode().
<?
$string="Our Lady Peace - Thief" ;
$seperated_value=explode("-",$string);
//seperate value based on '-' and put it in an array.
$artist =$seperated_value[0];
//Our Lady Peace
$song = $seperated_value[1];
//Thief
echo $artist;
echo $song;
?>
see manual for split() function example..
------------------
SR -
webshiju.com
www.jobxyz.com-IT Career Portal
ezipindia.com--WebStudio
"The fear of the LORD is the beginning of knowledge..."
August 17th, 2000, 11:09 PM
-
Thanks!!
I apprechiate the help.
Thanks,
Scott Lee