Jump to content

Verifying initials


squaringkarma

Recommended Posts

Hi again. What's a common way of verifying someone has entered their initials? My thought process was this:

  • Person enters their name in three separate fields on a form: First Name, Middle Initial, and Last Name.
  • [other fields not relating to this question.]
  • Person enters their initials in a field called Initials. If they didn't enter a Middle Initial, I ask them to enter in an * where it would be.
  • I would then take a substring of the First Name, Middle Initial, and Last Name fields and put them into an array. If they didn't enter a Middle Initial, I would somehow put the default value of that substring as an *.
  • I would then use implode to convert the array to a string.
  • Then I would compare the new string to the value of the field Initials.

 

...But I was wondering if there was a simpler/more intuitive way of doing the task. Hopefully my way made sense?

Link to comment
https://forums.phpfreaks.com/topic/144979-verifying-initials/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.