dimanche 6 mars 2016

PHP - Foreach object

I'm trying to loop through this data object in my view. However, I'm getting the following error: Trying to get property of non-object. This is the first time I've really ran into a issue with rendering arrays/objects...maybe it's just the case of the Sundays...but I can't get this foreach to output. Help?

{
    "0": {
        "id": 1108217089,
        "id_str": "1108217089",
        "name": "Marketing",
        "screen_name": "SocialMedia246",
        "location": "Canada",
        "description": "Marketing|PR|Brand Consultant.Lover of Music|Fashion & life.A dynamic young entrepreneur with an unconventional out of the box approach to marketing & business.",
    "1": {
        ...

Foreach:

@foreach ($search_results as $result => $profile)
    <div class="large-3 columns">               
        {{ $profile->id }}
    </div>
@endforeach



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire