I'm new to php and maybe this question has been asked before but i don't know what to search for specifically anyway here's the question
If I had a string like:
$adam = "this is a very long long string in here and has a lot of words";
I want to search inside this string for the first occurrence of the word "long" and the word "here", then select them with everything in between, and store it in a new string so the result should be:
$new_string = "long long string in here"
and by the way I wouldn't know the length of the string and the contents, all what I know is that it has the word long and the word here and I want them with the words in between.