phparraysvar-dump

how to store var_dump data in variables


I have the following var_dump data in my console. i want to store them in variables.

    array(1) {
      ["pupload"]=>
       array(5) {
        ["name"]=>
        string(11) "profile.jpg"
        ["type"]=>
        string(10) "image/jpeg"
        ["tmp_name"]=>
        string(45) "C:\Users\pcname\AppData\Local\Temp\phpAF1C.tmp"
        ["error"]=>
        int(0)
        ["size"]=>
        int(114348)
  }
}

UPDATE

My code

    $variable =   var_dump($_FILES);
    echo $variable;

Solution

  • As you said :- I want to store "name", "type" and "tmp_name" in variables

    And you tell that your variable is $_FILES. So do like below:-

    $name  = $_FILES['pupload']['name']; 
    $type  = $_FILES['pupload']['type']; 
    $tmp_name = $_FILES['pupload']['tmp_name']; 
    echo $name.' : '.$type.' : '.$tmp_name;