Ummm...Felgall, look what he wrote:
Can anyone help me with a php code.
He doesn't want a JS solution. He just posted in the wrong forum.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.