Forums

Displaying data from array

szabob 04 Dec, 2015
Hi,

I am using the form data like this: $form->data['comments'] It works great!😛

Now, I want to use data from an Array:
[file10] => Array
        (
            [name] => 20151204053146_1.jpg
            [original_name] => 1.jpg
            [path] => uploads/20151204053146_1.jpg
            [size] => 46080
            [link] => uploads/20151204053146_1.jpg
        )

I need to display the [original_name] from the [file10] array. How can I do this?

Cheers

Bob
GreyHead 04 Dec, 2015
Answer
Hi Bob,

I can't tell from the data there if that is from the $form->data[''] array or from $form->files :-( Probably $form->files, if so:
<?php
$form->data['original_name'] = $form->files['file10']['original_name'];
?>

Bob
szabob 04 Dec, 2015
Thanks Bob, $form->files['file10']['original_name'] that is! 😀

Cheers,

Bob
This topic is locked and no more replies can be posted.