I don't know why I'm blanking on this one. Basically, I have a string containing serial numbers. This string can have multiple newlines and carriage returns actually separating the serial numbers. I want to clean the string so that multiple newlines and carriage returns are removed. However, I still need to separate the remaining serial numbers with a comma. There isn't a consistent naming convention used, and there can be multiple occurrences of these carriage returns and newlines, so I can't just do something like:
str_replace("\r\n", "", $mystring)
or
str_replace("\r\n", ", ", $mystring)
So I need something like this:
V423060018
V311911037
-or-
V265141004
V265141004
V241889035
to be returned as:
V423060018, V311911037
-and-
V265141004, V265141004, V241889035
respectively.
Any thoughts?