I have a website where user can add reviews. Now Issue is some user add very lengthy strings and I'm unable to stop them to do that, like a user added a review:
aatdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
Another user put this review:
ggvddghjbxvjfuihdfjkljgghkkollkkkkkkļfghjjkjjjjjjjjjjhjbjjxxfdfhgsxvvbdsxvvgssxcxxźvgggfggffccccffghjjjjjjjhfdsxvhjnbdddhugsdhjnnhhjjjjnnjxxssfghjiikjkmjjhgcxsdghjkkkk
Here is code:
if (isset($_POST['addReview'])) {
$summary = isset($_POST['summary']) ? trim($_POST['summary']) : '';
How I can check input string length and make sure there are no reviews like above and input is only words?