php - My loop is only returning one value -
The issue here is that when I create an array with For the latter, I run the loop and I resonate to see the output, it gives only 1 value and I do not understand why this value very much Disappointed This is my code And here's a screenshot so you can see what I mean You have a semicolon then gets However I will recommend using instead which is very easy to use and also faster for loops $ picnameoutput then print_r It prints as the array you will see in the screenshot.
& lt ;? Php $ largedir = 'images / headshots / large'; $ Big = scandor ($ large scale); $ Picnameoutput = preg_grep ("/ Adam. * /", $ Large); Print_r ($ picnameoutput); ($ I = 0; $ i & lt; counts ($ picnameoutput); $ i ++); {Dumb "$ picnameoutput [$ i]"); }? & Gt;
; Then remove it for
() before bracket.
for
($ i = 0; $ i & lt; counts ($ picnameoutput); $ i ++); {Dumb "$ picnameoutput [$ i]"); } $ I + lt; Count ($ picnameoutput); $ I ++) {echo "$ picnameoutput [$ i for
]"; }
foreach ($ as picnameoutput $ pic) {echo $ pic; }
Comments
Post a Comment