I have 20 lines of string seperated with "\n".
I have 2 fields to put this string into:
$field1
is limited to 10 lines of string and
$field2
can store unlimited lines of string
How do I run a php code to separate the string into 2 fields?
The 1st-10th line will be stored in $field1
.
The 11th-? line will carry over to $field2
.
$array = explode("\n", $text);
$field1 = implode("\n", array_slice($array, 0, 10));
$field2 = implode("\n", array_slice($array, 10));