This may be simple and silly question but first I am learning php so your help would be appreciated.
I am trying to get variable with assigned conditional statement.
$gender = $curauth->gender; // getting from wordpress user profile.
if($gender === 'Male') {
echo 'his';
} else {
echo 'her';
}
So what I want to do is it will check if user is Male than in some description it will use his and if female it will use her. Something like below
echo 'jatin soni doesn't have set this option yet. His option will be deactivated soon.';
So here His will be set with above conditional code.
You can
echoit straight out:If you need that more than once or for readability reasons, you should assign it to a variable:
Next step could be variable substitution in double-quoted stringsDocs or the use of the
printfDocs function for formatted output.