We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

PHP script works outside of EE template but not inside one.

Development and Programming

Yodle UX's avatar
Yodle UX
18 posts
14 years ago
Yodle UX's avatar Yodle UX

Hey all,

I’m really stumped here. I have a custom PHP script that I need to use that basically takes a string that contains bullets (•) and splits that string into an array for processing a different way.

Really simple script that works fine on a standard (non EE) PHP page:

<?
$manyItems = "• the first thing • the second thing • the third thing •  etc •  etc";
$items = explode("•", $manyItems);
?>

Resulting in this:

$items[0] = "the first thing"
$items[1] = "the second thing"
$items[2] = "the third thing"
$items[3] = "etc"
$items[4] = "etc"

The problem comes when I put this PHP into an EE template. Suddenly the PHP cannot process the bullet (•) character anymore and everything comes out like so:

$items[0] = "• the first thing • the second thing • the third thing •  etc •  etc"

I have dug through documentation and cannot find anything that implies that character encoding is overridden by EE, everything should be using UTF-8, not that I’m even sure that’s the issue…

Has anyone else run into something like this?

[Mod Edit: Moved to the Development and Programming forum]

       
MrBaseball34's avatar
MrBaseball34
99 posts
14 years ago
MrBaseball34's avatar MrBaseball34

Use the HTMLEntity for the bullet and it should work.

•

or

•
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.