I need help with something very specific, which involves good interpretation, which is the following, I need to give a word in%% example% with% the last letter that would be regex
to be extended until the first sequence of nt
and stop, example ...
in
$txt = "nttttouterttt";
echo preg_replace('/nt/', '', $txt);
saida: tttouterttt
expected result
$txt = "nttttouterttt";
echo preg_replace('/nt/', '', $txt);
saida: outerttt
If the next letter was not 't', do not continue the sequence
$txt = "ntptttouterttt";
echo preg_replace('/nt/', '', $txt);
saida: ptttouterttt
t
is removed, but I would like to remove the t's
integer, leaving only nt
, if the string was nt>ttt<
it would only remove nt, is it possible? would there be another method? I accept suggestions and material ...