Forum Moderators: coopster

Message Too Old, No Replies

could not print out 2 elements from the array

         

xbl01234

3:39 am on Nov 12, 2011 (gmt 0)

10+ Year Member



Hi;
why i could not print out the 2 elements from the array of the final, it just print out the "Array"
Could anyone help, thanks

<?php
$string="talking animails and get rid off talking about this facebook";
$term="talking a";
preg_match_all("/talking a[a-zA-Z]*/", $string,$final);
$i=0;
while($i<2){
echo $final[$i];
$i++;
}
?>

Habtom

3:52 am on Nov 12, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change

echo $final[$i];

to

echo $final[0][$i];

xbl01234

8:28 pm on Nov 12, 2011 (gmt 0)

10+ Year Member



Thanks a lot