What is seen by ps?

If i have a script that assigns a string to a variable could someone in theory be able to see that variable via ps if they were logged on to the server? Are there any other logs that would show what is in that variable?

ps shows process arguments.
With options ps can peak process environment if the OS allows to access it. Most OS allow access for the process owner and uid#0 (root).
Exported shell variables are environment. Normal (not exported) shell variables are hidden to the outside.