How to send a variable to all other devices connected to a server?


what is the best way to send variable to other devices? I am currently making a simple card game and what I just want that happens is that when a player presses end turn that a Int in all other devices is changed to the player who has the next turn.
Player 2: played his cards (also means he ended it’s turn)
Player 2 script: (is it possible to do something like this) (I know how foreach works and I know this wouldn’t work but this is what I want to happen)
**Foreach (connected device)
int PlayerTurn += 1
not only this variable will have to change. Lists will need to change to(the player cards are in the list) or boolean will need to change.

Or is there a different way to just have a variable In common?

you can just mark the variable you want to send/ sync with [SyncVar]