mercredi 1 avril 2020

How can I display arrays one value in Laravel/PHP?

I have created an array and I want to display the array's value opens and closes

store_opens[store_times][monday][opens]

"store_opens" => array:1 [▼
    "store_times" => array:7 [▼
      "monday" => array:1 [▼
        "opens" => "09:00"
      ]
      "tuesday" => array:1 [▼
        "opens" => "09:00"
      ]
      "Wednesday" => array:1 [▼
        "opens" => "09:00"
      ]
      "Thursday" => array:1 [▼
        "opens" => "09:00"
      ]
      "Friday" => array:1 [▼
        "opens" => "09:00"
      ]
      "Saturday" => array:1 [▼
        "closes" => "10:00"
      ]
      "Sunday" => array:1 [▼
        "opens" => "10:00"
      ]
    ]
  ]

When I try to display it like this: $shop->jsonLDFields->store_closes. The result is all arrays values.

When I try to display it like this: $shop->jsonLDFields->store_closes['opens'] The result is null.

How could I display the opens and closes values in the view?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire