[Solved] How to I can split match letter in string PHP

[ad_1]

Try this;

>>> $string = 'ABCCDF[GH]IJJ[KLM]';
=> "ABCCDF[GH]IJJ[KLM]"
>>> preg_match_all('/\[(\w+)\]/', $string, $matches);
=> 2

$matches will look like below.

   [
     [
       "[GH]",
       "[KLM]",
     ],
     [
       "GH",
       "KLM",
     ],
   ]

2

[ad_2]

solved How to I can split match letter in string PHP