Answer the question
In order to leave comments, you need to log in
How to take something between characters using regular expressions?
There is a line like this: "||image|what-you-need-to-cut-and-assign-to-a-variable-to-output||".
You need to cut and assign to a variable what is between the character sets ||image| and ||, but it doesn't exit. Apparently due to the fact that special are used. characters "|" ?
I write like this:
if(preg_match('|/|/|image/|(.*)/|/|sei', $poster, $matches)) $poster = $matches[1];
else $poster = '';
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question