Sunday, April 28, 2019

html - Writing regular expression in PHP to wrap with




I want to make it so that any occurance of an image gets wrapped with a link to the image source



How can I write a pattern, in PHP so that I can find these variations, which are scattered throughout text coming from the database:



blah blah blah
blah blah blah



In all cases, I want them to appear within an link.


Answer



preg_replace("{}ims", '', $str)



handles all non-practical cases



alt text


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...