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

  • 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 '15 at 13:52

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.

  • 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 '15 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 '15 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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