I'm quite new to PHP and don't have as much experience with is as I do with other languages. I have the following form, and what I would like to do is to check if the firstname field begins with an uppercase, if the nickname field is lowercase, and if the lastname field is all uppercase. I've seen people turn strings and text into different cases but I don't know how to do the validation that I hope to achieve.
I've turned text into lower/upper/case but that's just half a line of very simple code from W3CSchools.
Also this isn't a duplicate of any other question. Others focus on pure PHP functions like creating a string and echoing a result, the other question doesn't even apply to what I'm trying to achieve, so there's my edit for that.
Here is the HTML:
<!DOCTYPE html>
<html>
<head>
<title>Testing case sensitive validations</title>
</head>
<body>
<form name="newform" method="post" action="walkin.php">
Firstname <input type="text" name="fname"><br><br>
Nickname <input type="text" name="nname"><br><br>
Lastname <input type="text" name="lname"><br><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
Here is the PHP I have so far:
<?php
if (isset($_POST['submit'])) {
$fname = $_POST['fname'];
$nname = $_POST['nname'];
$lname = $_POST['lname'];
}
?>