0

How to get a particular part of a string? e.g after some special characters or some words.

1
  • Bit vague on your requirement, how about an example in a template? Is the string output by channel:entries for example? Are the words you're searching for dynamic or consistent? Dec 15, 2015 at 13:52

1 Answer 1

2

Use the PHPStringFun add-on and use regX either with substr or str_replace. Alternatively you could use Low Replace or MX Jumper. Or you could even activate PHP on the template and post parse. All depends on your exact requirement.

2
  • A simple PHP substr() should do, I think. But yes, would be nice to know a bit more about the OPs requirements.
    – Ingmar
    Dec 15, 2015 at 14:07
  • Or as someone pointed out to me, you might want to use mb_substr() depending if you have utf8 characters: stackoverflow.com/questions/13120732/… Dec 15, 2015 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.