[code]
[1] text 1
[2] text 2
[3] text 3
[/code]
そのため、値text 1, text 2, text 3
が配列である必要があります。
これで私の悩み:
$matches = preg_match_all( "/^\[\d{1,3}\](.*)/", $content, $tags );
空の値を持つ配列を返します:
Array
(
[0] => Array
(
)
[1] => Array
(
)
)
1
それを修正する方法またはそれを良くする方法は?
[code]
[1] text 1
Different content here
[2] text 2 Another dif..
[3] Also something either
to be continues!
[/code]
text 1
複数行の場合、配列の最初の要素のすべてのコードではなく、1 つのコードのみが返されます
Array
(
[0] => Array
(
[0] => [1] text 1
[1] => [2] text 2 Another dif..
[2] => [3] Also something either
)
[1] => Array
(
[0] => text 1
[1] => text 2 Another dif..
[2] => Also something either
)
)
1
また、他の要素も最初の文字列の結果のみになります。