I'm triying to delete the text between include
and the next &
in the text:
filter[mat]=1&filter[status]=available&include=homeCompetitor,awayCompetitor&sort=scheduled
and get a text like:
filter[mat]=1&filter[status]=available&sort=scheduled
I tried with the following codes:
function delete_all_between($string)
{
$beginningPos = strpos($string, $beginning);
$endPos = strpos($string, $end);
if ($beginningPos === false || $endPos === false)
return $string;
}
and also with:
preg_replace("/\include[^]+\&/","",$string);
But none worked.
It may also be that the text also has the following format:
filter[mat]=1&filter[status]=available&sort=scheduled&include=homeCompetitor,awayCompetitor
With which I need to delete from the word include to the end (in this case there is no &
)
EDIT: This question isn't duplicated because that answer didn't work for me!