-4

I know this should be a relatively simple thing but I have not been able to do it yet. I have look hi and low and every example I try it fails I am sure it is fairly simple

Here is my array. I need to get the value of name last and filenames Any help would be most appreciated.

Thanks!!

Array
(
    [formData] => Array
        (
            [name] => TEST
            [last] => TEST1
            [filenames] => Array
                (
                    [0] => /ocdata/uploads/export-1511887767.csv
                )

        )

)
u_mulder
  • 54,101
  • 5
  • 48
  • 64

1 Answers1

-2

Really simple method to see your content:

foreach($array as $k => $v)
{
   echo $k . $v . PHP_EOL; // see content of your array
}

Or use directly the values:

$array['formData']['name'];
$array['formData']['last'];
$array['formData']['filenames'];
Mecanik
  • 1,539
  • 1
  • 20
  • 50
  • 2
    Doesn't really answer the question and `Notice: Array to string conversion` – AbraCadaver Nov 30 '17 at 16:58
  • 1
    While this may answer the question in a way, the answer could be majorly improved by showing OP the _proper_ way to do it, vs "just a way". If it generates a notice or an error, it's not the right way. Teach a man to fish and all that.... – GrumpyCrouton Nov 30 '17 at 17:16
  • Thanks everyone your answer were correct sorry it was a completely different issue that was haunting me. It had nothing to do with the array once I figured it out (i cannot even remember what it was) everything worked fine. – Rick Venuto Dec 08 '17 at 20:19
  • Well I’m glad I helped anyway. – Mecanik Dec 09 '17 at 00:03