I have a string of values that are trailed by carets and groups of words are separated by semicolons.
I tried to split the string on semicolons, but I only want the first word after each semicolon without its trailing caret.
$myString = "apple^;ball^room^mouse^bat^;cricket^news^man^";
$myArray = explode(';', $myString);
print_r($myArray);
I want output from above string as below in single variable:
apple ball cricket
means first character befor caret sign of each semicolon