evachick156
New member
I have the following string read from database
$rows['string'] = "Teach t1, t2, t3 ; Practice p2"
What im trying to do is put "Teach" into $teach variable and "Practice" into $pract variable.
But i need t1, t2, t3 in an array, and than p2 into another array...please help! Here is my code but its not working on how i want it....
$string = trim($rows['string'], "Teach");
$string = trim($string, ";");
$string = trim($string, "Practice");
$str = explode(',', $string);
$rw0 = $str[0];
$rw1 = $str[1];
$rw2 = $str[2];
$rw3 = $str[3];
$rows['string'] = "Teach t1, t2, t3 ; Practice p2"
What im trying to do is put "Teach" into $teach variable and "Practice" into $pract variable.
But i need t1, t2, t3 in an array, and than p2 into another array...please help! Here is my code but its not working on how i want it....
$string = trim($rows['string'], "Teach");
$string = trim($string, ";");
$string = trim($string, "Practice");
$str = explode(',', $string);
$rw0 = $str[0];
$rw1 = $str[1];
$rw2 = $str[2];
$rw3 = $str[3];