Topic: funkcija explode() ir perdaug iskaido
is duomenu bazes gaunu kintamaji $eile['klausimas'], kuriame irasyta:
2011-03-07 16:29:49|Klausimas:|qqqqqq
2011-03-07 17:38:34|Klausimas:|asdfsddfdfbsdgbgbf
2011-03-07 17:40:25|Klausimas:|sdsdvsfvdsfdv
2011-03-07 21:10:47|Klausimas:|bggggggggggggg
vygdau veiksmus:
$array = explode("\n", $eile['klausimas']);
$kiek = count($array)-1;
$sk=$sk-1;
while ( $sk <$kiek-1 ) {
$zinute = explode("|", $array["$sk"]);
echo $zinute[$sk]['0'] .'<br>'.$zinute[$sk]['1'].'<br>'.$zinute[$sk]['2'];
$sk++;
}
ir is echo gaunu kazkoki keista atsakyma
2
0
1 K
l
a s
d
s
kazka sumaisiau array in array mane visai supainojo.
kodel negaunu tinkamo atsakymo?
turetu but
2011-03-07 16:29:49
Klausimas:
qqqqqq
ir t.t.
jeigu padarau
echo $array[0].'<br>'.$array[1].'<br>'.$array[2];
gaunu tinkama atsakyma
2011-03-07 16:29:49|Klausimas:|qqqqqq
2011-03-07 17:38:34|Klausimas:|asdfsddfdfbsdgbgbf
2011-03-07 17:40:25|Klausimas:|sdsdvsfvdsfdv