I'm getting this error Error: Call to a member function remove() on array in file
How can I remove specific data from array where clinic_id matches?
    $factory = (new Factory())->withServiceAccount($app)
        ->withDatabaseUri('db');
    $database = $factory->createDatabase();
    $reference = $database->getReference('list_notification')->getValue();
   foreach ($reference as $ref){
        if($ref["clinic_id"] === $clinicId){
            $ref->remove();
        }
    }

 
    