I've searched for hours. How can I separate a string by a "\"
I need to separate HORSE\COW into two words and lose the backslash.
$array = explode("\\",$string);
This will give you an array, for "HORSE\COW"
it will give $array[0] = "HORSE"
and $array[1] = "COW"
. With "HORSE\COW\CHICKEN"
, $array[2]
would be "CHICKEN"
Since backslashes are the escape character, they must be escaped by another backslash.