Hello to all,
I want to put the word/s inputed in textarea by rows and distribute it in an array. I have textarea with a name Query.
for example user inputed this words
[B]test drive
preview post
please help
thank you
I want the row 1(test drive) to save in variable $q1[0] and so on….
please help me… Below is my code
[B]<?php
$Query = $_POST[‘Query’];
$j=5;
$len = strlen($Query);
$ctr=0;
$sctr=0;
$pos=0;
$start=0;
$qctr=0;
$last=strrpos($Query, “n”);
$lmt=substr($Query, $last, $len);
while($lmt!=$test)
{
$test=substr($Query, $start, $sctr);
$pos=strpos($test, “n”);
if($pos === FALSE)
{
//echo ‘”n” not found in string’;
$sctr++;
}
else
{
$q1[$qctr]=substr($Query, $start, $pos);
$start=$pos;
$sctr=0;
$qctr++;
}
}
for($k=0;$k<=$qctr;$k++);
{
echo $q1[$k];
}
?>