-1

I type textarea text, for example:

22.333.45.16

122.12.65.143

14.14.111.11234

text

How I can take every line to array? Is it possible or not?

butteff
  • 115
  • 2
  • 9

1 Answers1

5

Like this:

$input = $_POST["nameOfTextarea"];
$lines = explode("\n", $input);

This splits the string into an array based on the delimiter \n (which is a line break). Here's the docs for explode().

Hayden Schiff
  • 3,280
  • 19
  • 41