Q:

PHP strings and tick marks

Trying to add this query mobile date picker to my page.  I am using PHP to create the form of each page, so I am doing a lot of string concatenation.  The format for this date picker looks like this: 
<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "calbox"}'>

So I have a line that looks like this: 
$form .= '<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "calbox"}'>';

The tick marks around the curly brackets are causing problems.  I have tried escaping them with extra ticks such as:
data-options='''{"mode".....}'''

and faking it out with:
data-options=&#39;{"mode"....}&#39;

can't make it work, help much appreciated.

A:

Escape quotes with a \, like this:
$form .= '<input name="mydate" id="mydate" type="date" data-role="datebox" data-options=\'{"mode": "calbox"}\'>';

