During the development process, we often encounter the need to provide an input box for others, and then others enter some IDs or keywords, such as the tag input box in the WordPress background:
This is just to determine the comma in the English state. What if someone accidentally enters a comma in the Chinese state? What to do with the decimal point?
So I wrote an expression using regular expressions to replace spaces and line breaks with commas.
Replace the submitted ID with spaces, line breaks, etc. into commas, and then use the explode function to switch to an array.
This is filtering with a decimal point added.
OK, after processing like this, there will be no problem.
Tip: In fact, the editor feels that using JS to handle this problem before submission is a better choice.