I have this string: $path = "[other values] and dateStart >= '2021-01-01' and dateEnd <= '2021-12-31' and [other values ...]'";
What I am tring to do is to replace the value after dateStart with 2021-02-02.
I tried using $test = substr($path, 0, strpos($path, 'dateStart >= ')); but it only returns everything before 'dateStart' ...
Any ideas?
dateStartwith2021-02-02, will it make sense, because the end date will be smaller?substrReturns the portion of string specified by the offset and length parameters. andstrposwill Find the numeric position of the first occurrence of needle in the haystack string. There is no notion of2021-02-02as a replacement in the code.