Php helps you to quickly build big applications and many times, its easy to neglect the security matter. Its easy to believe that security breaches could not happen to your software. But what if it does happen? For this reason, security in your applications should be kept in consideration from the beginning.
Lets come back to the variables themselves. In addition to checking the type of variable, we can also check the size or length as well. One of the largest exploited issues among all types of software are 'buffer overflow' problems. This is when more data is passed than the variables expect, and the data starts filling in other memory and variable locations. If you check the length and size of your data, then you can harden yourself to this kind of exploit. For example:
<a href = index.php?action=1> Page1 </a>
Use this code to check if the variable content has more than one character.