5

I'm working on a long string grabbed from a Session that uses "§" (Section sign) to group and divide different parts of the string.

Example: "ArticleID | Title | Date § ArticleID | Title | Date § ArticleID | Title | Date"

I want to put this into an array using: explode("§",$str);

However, for some reason the character is totally ignored.

I have simply used a different character instead to get this working but why does PHP not recognise it?

ticallian
  • 1,631
  • 7
  • 24
  • 34

1 Answers1

7

Check the file encoding. This § can be being passed to explode() as "\xA7", "\xA7\x00" or "\xC2\xA7" depending if the PHP file is encoded as ASCII, UNICODE or UTF-8 respectively.

Havenard
  • 27,022
  • 5
  • 36
  • 62
  • 1
    What do you mean *Unicode **or** UTF-8*? There is no such thing as encoded as Unicode. This makes no sense. – tchrist Nov 02 '10 at 23:28