Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // the folowing code is on screen using:
- foreach($foto as $array){
- // loop door de objecten heen
- foreach($array as $key => $value){
- echo $key . " ". $value . "<br>";
- }
- }
- echo "<br><br>";
- echo "<pre>";
- var_dump($foto);
- echo "</pre>";
- It prints on screen:
- How do i acces those value in the array.
- The array had 3 object with: id, filename , tmp_name, type, size, caption
- how can i acces those vars by going in like $foto[1][íd'].....
- id 1
- filename image.jpg
- tmp_name
- type jpg
- size 10255
- caption bij het water?
- id 2
- filename top.jpg
- tmp_name
- type image/jpeg
- size 17091
- caption 123
- id 3
- filename walter pothof boxed image.jpg
- tmp_name
- type image/jpeg
- size 44711
- caption 66
- array(3) {
- [0]=>
- object(photoclass)#6 (6) {
- ["id"]=>
- string(1) "1"
- ["filename"]=>
- string(9) "image.jpg"
- ["tmp_name"]=>
- NULL
- ["type"]=>
- string(3) "jpg"
- ["size"]=>
- string(5) "10255"
- ["caption"]=>
- string(14) "bij het water?"
- }
- [1]=>
- object(photoclass)#7 (6) {
- ["id"]=>
- string(1) "2"
- ["filename"]=>
- string(7) "top.jpg"
- ["tmp_name"]=>
- NULL
- ["type"]=>
- string(10) "image/jpeg"
- ["size"]=>
- string(5) "17091"
- ["caption"]=>
- string(4) "123 "
- }
- [2]=>
- object(photoclass)#8 (6) {
- ["id"]=>
- string(1) "3"
- ["filename"]=>
- string(29) "walter pothof boxed image.jpg"
- ["tmp_name"]=>
- NULL
- ["type"]=>
- string(10) "image/jpeg"
- ["size"]=>
- string(5) "44711"
- ["caption"]=>
- string(3) "66 "
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment