I have an input where the user informs several product codes, and the system returns a list.
But I need to validate the string
or verify it is exactly like this: 132,234,14,56
That is, each code separated by a comma.
I tried to do this, but it did not work:
if (preg_match('/^,/', $ids)) {
echo "erro nas informações";
}
NOTE: It must always be integers, separated by, can not end with, can not contain letters and no space.