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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

What do you mean Unicode or UTF-8? There is no such thing as encoded as Unicode. This makes no sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.