With PHP, how to get substring "aaa-bbb" from "string1 string2 aaa-bbb string3" when I only know "aaa"?

QuestionsWith PHP, how to get substring "aaa-bbb" from "string1 string2 aaa-bbb string3" when I only know "aaa"?
Jehal Desai Staff asked 7 years ago

Say you have something like a class name:

Sometimes there will be a string in this class along the lines . I get such elements via in PHP:

But then I need to get the rest of the string. So if I have , I need to get . I can get easily from , so really this comes down to extracting .
How can I do this with an Xpath query?


View on Stack Overflow