i have searched through the Internet and found a solution to this but it do it in a reverse order.
original string
S0597 KIPATIMU SECONDARY DIV-I = 0 DIV-II = 3
string to be extracted
S0597 KIPATIMU SECONDARY
extraction should stop when "DIV-" is reached.
my code output
DIV-I = 0 DIV-II = 3
here is my code.
if(($pos = strpos($string, 'DIV-')) !== false)
{
$school_name = substr($string, $pos);
}
else
{
$school_name = get_last_word($string);
}
echo $school_name;
how can i achieve this?