HealthLinks is your destination for reliable, understandable, and credible health information and expert advice that always keeps why you came to us in mind.

How to Escape Quotes in PHP

104 29
    • 1). Right-click the PHP file you want to edit and select "Open With." Click the PHP file editor you want to use to change the code.

    • 2). Locate the string that contains the quotes. The following code shows you how to create a PHP string, if you do not already have one defined:

      $var = 'this string with a quote "';

    • 3). Add the "addslashes" function to the string. The following code shows you how to add the escape backslash character in front of the quotes:

      $var = addslashes($var);

Source...

Leave A Reply

Your email address will not be published.