How to read TextArea Line by Line?
I wanna ask about how do i read a TextArea Line by Line
e.g
my text area have 3 lines
v1234567
v1234555
v1234666
how do i get the record line by line like
when i read first line its return me v1234567
and then 2nd line return me v1234555
I would want to do it in a loop as I want to use the record in a loop
Regards and Thanks for all help.
How to read TextArea Line by Line?
Moderator: General Moderators
Re: How to read TextArea Line by Line?
Explode the form element on a carriage return to turn it into an array...
Code: Select all
$lines = explode("\n", $_POST['textarea']);
foreach ($lines as $line) {
echo ++c." ".$line."<br>";
}Re: How to read TextArea Line by Line?
is the "line feeder" from all browser is the same?
I mean, did IE send line feeder only LF(\n), as long as I know windows use CR-LF(\r\n) for line feeder, and Mac use only CR
thx
I mean, did IE send line feeder only LF(\n), as long as I know windows use CR-LF(\r\n) for line feeder, and Mac use only CR
thx