How to Double Quote in PHP

PHP is a scripting language that provides methods and functions for manipulating server files. The double quote is used to define a string, often a string variable. The double-quoted string can contain other variables and escaped characters, such as $myvar and “\n,” which will be parsed, or represented in their text form when output. You can also define a PHP string that includes double quotes.

Instructions

    • 1

      Open the PHP file using a text, HTML or PHP editor.

    • 2

      Type the string surrounded by single quotes:

      $outputString = ‘”I want the double quotes to display in this string”’;

    • 3

      Type the string, using the backslash to escape the literal double quotes:

      $outputString = “\”I want the double quotes to display in this string\””;

    • 4

      Save the PHP file and transfer it to your server for testing.

Related Searches:

Resources

Comments

Related Ads

Featured