Why can't I fill this php array in while loop? -


i'm trying add values array in while loop in php, however, can't seem so. values added array if test strings, using variables doesn't work. variables ($array[$j][0]) can echoed not added added array.

while($j>0){     $added=array();     $added[]=$array[$j][0]; } print_r($added); 

each time $added array getting reset(empty) in while loop. use below code

    $added=array(); while($j>0){     $added[]=$array[$j][0]; } print_r($added); 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -