How to str_replace
</div>
</li>
</ul>
to
</div>
</li>
</ul>
aaa
All the tags in a new line.
I tried
$str = str_replace('</div>\n\r</li>\n\r</ul>', '</div>\n\r</li>\n\r</ul>\n\raaa', $str);
UPDATE CODE:
$str =<<<EOT
</div>
</li>
</ul>
EOT;
$str = str_replace("</div>\n\r</li>\n\r</ul>", "</div>\n\r</li>\n\r</ul>\n\raaa", $str);
echo $str;
\nin single quotes is a literal\and a literaln, rather than a\n, to get the line breaks you need to use double quotes:Also, you should be replacing
\r\nnot\n\ras Windows line breaks are a carriage return\rfollowed by a line break\n.