I have a php variable that has a value that varies depending on the time !! Example
1st moment $valor = 300
2nd moment $valor = 20
3rd moment $valor = 5300
4th moment $valor = 1300
I also have an input, this input can add any value as long as it is below the value at the moment of typing. Here's what I want to do !! If someone comes to enter a higher value in the input the value automatically changes to the maximum and not to what was typed !!
Example:
1st moment $valor = 300
|| In that first moment the maximum value of the input can be only 300 !! But instead of 300 the user typed 301, at the same time I want these 301 to turn 300 as it is the limit value the user has!