<?php
$numbers=$_POST['numbers'];
if(!$_POST['Submit']) { ?>
<form name="form1" method="post" action="">
<p>
<textarea name="numbers" cols="100" rows="15"
id="numbers"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<?
} else {
//$replaced=preg_replace("/\n$/", ',', $numbers);
$exploded=explode('\n', $numbers);
?>
<form name="form1" method="post" action="">
<p>
<textarea name="numbers" cols="100" rows="15" id="numbers"><? echo
$exploded[0], $exploded[1]; ?></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<? } ?>
----------------------------------------------
I have this code, I need to insert some numbers in the textbox
for example:
585284
582084
585209
964587
and so on, then i want them to be exploded and echoed back separated by
commas. How can i exploded then into an array separated by new line?