Erase or Ignore everything after sign?
I have an expression that I need to clean up. It's pullled out from a feed and it's like this:
but it also can be:
or like this:
In either 3 cases, I want only everything before the "|" and forget this and the rest of the line...
How to do this?
Thanks for the help.
let's say all your stuff is in a string
$string = "field1,field2|field3,field4";
$arr = explode("|",$string);
$the_thing_you_need = $arr;
this should work.