Answer the question
In order to leave comments, you need to log in
PHP, MySQL. anti-repeat
The essence is this:
There is a database in which the name of the author (by the user) is entered, for example.
The user can enter: Pushkin, Pushkin Alexander, Alexander Sergeevich Pushkin, Pushkin A S, A S Pushkin (well, you understand. How to deal with this more competently? So that it is not like in VK and the like.
Answer the question
In order to leave comments, you need to log in
Create a list from which users will choose. And give the opportunity to add new authors with moderation.
make several fields, First name Last name Middle name and check when you try to add.
I think I understand what the author wants. If you only need the name, cut off everything after the space. Or don't let it make a space with javascript (and special characters wouldn't hurt). But it won't save you from 'PushkaAS'
The name was like a specific case. What to do If this is not the name of a person, but for example the name of something that can be written in different ways. Let's say there are 3 words in the title, which the user can swap, take one word in brackets or quotes, etc.
Bring into one "normal" form: discard garbage (punctuation marks, for example), convert to one case, expand abbreviations (or vice versa, collapse into them) sort words alphabetically
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question