ktamas77 / firebase-php

Firebase PHP Client
792 stars 215 forks source link

Some tips needed on updating foreach loop #56

Closed Fayozjon closed 6 years ago

Fayozjon commented 8 years ago

Hi there! Can you suggest me i want to update


$this->firebase = new \Firebase\FirebaseLib($DEFAULT_URL, $DEFAULT_TOKEN);
        $uzrs = json_decode($this->firebase->get('users'));
        foreach($uzrs as $user){
        echo "<pre>";   

            foreach($user->chat as $msgs){ 
                if($msgs->type=="image"){
                 // HOW TO UPDATE HEREEEEEEEEEEEEEEEEEE

//HOW TO ADD SOME ADDITIONAL INFO AT CURRENT PATH?
            $this->firebase->push($user->chat,['name'=>'TEST','type'=>'text','message'=>'test test']); /// <!---- THIS NOT WORKING
                }

            }