Sebastian G.
Sebastian G.

Reputation: 636

Explode does not split my string because of a special character

short question:

I want to split a title which looks like this:

$text = This is a text • and this too

I tried the following:

$arry = explode('•',$text);

But it cannot find the Bullet symbol... So it just returns me an array with the Text in it. Do i need to convert it into another format, or how can i solve this problem?

Upvotes: 2

Views: 1723

Answers (1)

hiith
hiith

Reputation: 76

Depending on your encoding, try something like:

explode(chr(149), $text);  //for ISO-8859-1

Or

explode(utf8_encode('•'), $text);  //for UTF-8

Upvotes: 5

Related Questions