I'm trying to use str_replace to change a part of the code,
$mudali = "li id=\"cabeca{$raiz}\" class=\"cabeca\"";
$mudali2 = "li id=\"pes{$raiz}\" class=\"pes\"";
echo $mudali; // resultado li id="cabeca-geral" class="cabeca"
echo $mudali2; // resultado li id="pes-geral" class="pes"
$rodape = str_replace($mudali, $mudali2, $rodape);
But it does not work, but if I pull everything up to double quotation marks, the code works.
$mudali = "cabeca{$raiz}";
$mudali2 = "pes{$raiz}";
echo $mudali; // resultado cabeca-geral
echo $mudali2; // resultado pes-geral
$rodape = str_replace($mudali, $mudali2, $rodape);
Does anyone know how to fix it?