We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Need help to use preg_replace

How Do I?

MINDSCREEN's avatar
MINDSCREEN
218 posts
10 years ago
MINDSCREEN's avatar MINDSCREEN

Hi

I want to search & replace

<a href="http://theconversation.com">The Conversation</a> as <a href="http://theconversation.com" class="external_link">The Conversation</a>

using

{exp:low_replace find="you" replace="we"}
text you want processed
{/exp:low_replace}

Using following PHP, it can be done

$result = preg_replace('/(<a\b[^><]*)>/i', '$1 class="external_link">', $str);

, but how it can be done this using {exp:low_replace}

Please help.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.