I am trying place each paragraph from a block of text into its own form field textarea.
I have managed to do this with the following code, however the code always leaves
one unwanted empty teaxtarea field at the end of the page
$textArray = explode("</p>", $text);
for ($i = 0; $i < sizeof($textArray); $i++) {
$textArray[$i] = strip_tags($textArray[$i]);
echo "<textarea>$textArray[$i]</textarea><br /><br />";
}
I tried changing the code to the following without success -
$textArray = explode("</p>", $text);
$len = count($textArray);
for ($i = 0; $i < sizeof($textArray); $i++) {
$textArray[$i] = strip_tags($textArray[$i]);
echo "<textarea>$textArray[$i]</textarea><br /><br />";
if($len == -1) {
break;
}
}