D
D
DEamON_M2015-11-18 09:33:53
PHP
DEamON_M, 2015-11-18 09:33:53

How to properly split a string using preg_split()?

There is a line

текст текст текст {{любой_нужный_текст}} текст 
текст текст текст {{еще_любой_нужный_текст}}текст текст {{еще_сколько_угодно_раз_нужный_текст}}
текст текст

It is required to get from it what is in curly braces, that is, the resulting array should be of the form
[
0 => 'любой_нужный_текст',
1 => 'еще_любой_нужный_текст',
2 => 'еще_сколько_угодно_раз_нужный_текст',
]

I'm bad in the regular season. I'm fighting for the second day

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2015-11-18
@DEamON_M

So? https://regex101.com/r/wX4yJ9/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question