
PHP - preg_replace to add something after closing tag :
Here i will explain how to add something like string, char (or) any html tag after closing tag. Here we are using preg_replace() function to do it.
In the below example, add <br /> tag after closing of all <img> tag.
Syntax :
preg_replace('/(<img[^>]+>(?:<\/img>)?)/i',...