I have a little problem with working on strings in PHP.
Imagine a CSV file with these fields:
ItemID;ItemText;ItemVAT;ItemEAN;
Clearly, the separator in this string is ";". The problem is, that values from "ItemText" might contain the ";", too.
I need to filter these strings and replace the containing ";" with something else, like "#" or "$", doesn't matter. I tried counting the ";" with substr_count
to determine if I have an additional ";" (in comparision to the count of a "normal" value string). But I don't know how to find the actual ";" in the value. To make things harder, there can be more than one ";" in the value string.
Anyone got some ideas how to filter these unnecessary ";"?
You can do something like this if you have this fields always.