Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nesting with three levels of quotations

Tags:

I am trying to create a php variable that has three levels of nested quotes. How do I make a third level around "tackEvent", "downloads", "all", and "nofilter"? The double quotes that I have there are not working.

  $outputList .= "<a href=files/".$content_file ." onClick='_gaq.push (["_trackEvent", "downloads", "all", "nofilter"]);' >" . $content_name .  "</a>"; 
like image 526
JSW189 Avatar asked Sep 30 '11 18:09

JSW189


People also ask

What does 3 quotation marks mean?

The triple quotation is a nice way to be able to include other types of quotation within your string without having to use escape characters. For example: print("He said \"my name's John\"") That example requires escape characters \" to use double quote marks.

Do you ever use 3 quotation marks?

Using quotes within quotes As you can see in the example above, the closing quotations almost look like three marks. That's what it looks like when you have a single quote next to a double quote. It might seem odd, but it's grammatically correct.

What are the 3 rules of using with quotation marks?

Direct quotations involve incorporating another person's exact words into your own writing. Quotation marks always come in pairs. Do not open a quotation and fail to close it at the end of the quoted material. Capitalize the first letter of a direct quote when the quoted material is a complete sentence.


1 Answers

From here:

  • Outer quote = " (This marks the beginning and end of the string)
  • Inner quote = \" (Escaped as to not flag "beginning/end of string")
  • Third-tier quote = ' (Literal quote)
  • Fourth-tier quote = \' (Literal quote that will be generated as an escaped outer quote)
like image 59
Nick Brunt Avatar answered Nov 22 '22 15:11

Nick Brunt