• I have written a customer plugin that has a admin page that allows you to enter text and save it to a custom table. When i enter text like [“Hello”] it adds a \ infront of each “.

    does anyone have any ideas why and how to fix?

    I can provide code snips if needed.

    Thanks in advanace.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    It does that to escape those items so they aren’t misinterpreted when the code is parsed. Certain characters, like quotation marks, have computer code meaning, and need to be escaped so that they are interpreted as part of the text, rather than as code. For instance, in the case of quotes, they are used in PHP to signal the beginning and end of a string. So you can see that if a quote mark you add isn’t escaped, it could confuse the parsing of the code.

    Thread Starter Double_D

    (@double_d)

    But it keeps adding more slashes everytime i save the data to the database
    “HELLO” then becomes
    \”Hello\” then becomes
    \\\”Hello\\\” then becomes
    \\\\\\\”Hello\\\\\\\” etc……

    Moderator bcworkz

    (@bcworkz)

    Use stripslashes() somewhere in the data flow to keep them tamed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customer plugin adding slash to quotations’ is closed to new replies.