I've to save user names and bio for a multilingual site. Because number of languages used will be changed overtime, I'm trying to get them from a html textarea in following format.
[lang:en]
Some content some content some content
some content some content
some content
[endlang:en]
[lang:zh]
有些内容有些内容有些内容
一些内容有些内容
一些内容
[endlang:zh]
So when the form is submitted I want to obtain content separated according to the language. I'm using preg_match_all :
$count = preg_match_all('|\[lang:([a-z]{2})\](.*)\[endlang:[a-z]{2}\]|si',$value,$matches);
But it doesn't catch anything. What should I do to fix this expression?