0

In below code,I want to save only the name in DB. But How do i get name only from below array. Please suggest me a solution to get a name

Array
(
    [0] => Array
        (
            [name] => boy_1_6.jpg
            [type] => image/jpeg
            [tmp_name] => /tmp/phpti6eaW
            [error] => 0
            [size] => 33454
            [file] => boy_1_6.jpg
            [url] => http://localhost/magento220/pub/media//boy_1_6.jpg
            [previewType] => image
        )

)
5
  • is every time get only 0 id data? Nov 15, 2017 at 11:46
  • No. I have passed id as null
    – Jaisa
    Nov 15, 2017 at 12:54
  • can you write your code how you get that array? Nov 15, 2017 at 14:49
  • I am saving a ui form in DB. All the fields are saved in DB except image.But for image i got the above array.I did not know how to resolve it
    – Jaisa
    Nov 16, 2017 at 3:59
  • Please refer this below link , then you can have better understand about my problem. magento.stackexchange.com/questions/201658/…
    – Jaisa
    Nov 16, 2017 at 4:17

1 Answer 1

2

if the array store is variable $arr

than access name just like below

$arr[0]['name']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.