Skip to main content
January 14, 2017
Answered

How to get menu for special characters in PHP?

  • January 14, 2017
  • 1 reply
  • 1112 views

Hello,

with my older DW I entered & and got - no matter where - a pulldown menu to select special characters.

Now with the newest DW this works not anymore inside PHP code. How do I get it back?

Thank you

Claus

    This topic has been closed for replies.
    Correct answer David_Powers

    But this does not work in PHP code. Fine only in HTML code.

    And thats what I want to get this pull down menu inside PHP code to be sure that no square-questionmark-placeholders pop up.

    An example:

    Claus in Iceland - 23 July 2016 - Snæfellsnes. This and that, landscape.

    Oh, it should be æ and not this "A:". Also on the website should appear

    23 July 2016 – Snæfellsnes. This and that, landscape.     (Picture 1 of 9)

    Snæfellsnes. I.

    above the picture.


    clauss9448021 wrote:

    But this does not work in PHP code. Fine only in HTML code.

    And thats what I want to get this pull down menu inside PHP code to be sure that no square-questionmark-placeholders pop up.

    No, of course it won't work in PHP code. What you're trying to do is to create an HTML character entity. If you want to use HTML code, switch out of PHP.

    It sounds as though you are trying to use echo to display your text. When you create a string in PHP code, Dreamweaver treats it as literal text. It has no way of knowing you're trying to insert HTML.

    clauss9448021 wrote:

    An example:

    Claus in Iceland - 23 July 2016 - Snæfellsnes. This and that, landscape.

    Oh, it should be æ and not this "A:". Also on the website should appear

    23 July 2016 – Snæfellsnes. This and that, landscape. (Picture 1 of 9)

    Snæfellsnes. I.

    above the picture.

    I've just taken a look at your website. Snæfellsnes is displayed correctly:

    If you're seeing SnĦfellsness, it means that there's an encoding conflict. UTF-8 characters are being rendered as ISO-8859-1 (Western European). All browsers now support UTF-8, so there's no reason to be using Western European as your encoding.

    1 reply

    BenPleysier
    Community Expert
    Community Expert
    January 14, 2017

    I am not sure, but I do not think that Special HTML Characters were ever allowed in PHP.  To convert characters from PHP use the htmlspecialchars() function as per PHP htmlspecialchars() Function

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    January 14, 2017

    I used always the &...; also in PHP variables e.g. $text = "ð" (this is the Icelandic letter ð).

    BenPleysier
    Community Expert
    Community Expert
    January 14, 2017

    When you set the charset to UTF-8, do you still need to use the special character? Can't you just use the letter?

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!