我的行中有这样的东西
[0] -> * Row: {{t|fa|kuinka}}, {{t+|ti|miten}}, {{t|fi|millä tavalla|sc=Hani}}, {{t+|fi|millä tavalla|sc=Hani|sc=Td}}
我怎样才能得到这样的?
[0] -> fa|kuinka; ti|miten; fi|millä tavalla; fi|millä tavalla
答案 0 :(得分:0)
You'll need a preg_match_all
call with a pattern like this:
{{[t+]{1,2}\|([^}\|]*)\|([^}\|]*)[\|]?([^}\|]+)[\|]?([^}\|]+)}}
Then you can obtain te single pieces from the resulting array, see the docs: http://php.net/manual/en/function.preg-match-all.php