title: jQuery Ajax return multiple data
body: <p>I am using jQuery AJAX to return a string from PHP which consists of some JavaScript, PHP and HTML.</p>
  
  <p>I can successfully do this with the following code:</p>
  
  <pre><code>header("Content-Type: text/html");
  echo $content;
  
  $.ajax({
      type: 'POST',
      url: url,
      data: data,
  }).done(function(result) {
  
  }).fail(function(jqXHR, textStatus, errorThrown) {
      console.log(jqXHR, textStatus, errorThrown);
  });
  </code></pre>
  
  <p>The problem I have now is that I want to return some other simple values along this string as well.</p>
  
  <p>But if I use <code>json_encode</code> to send an array of these values, it will break my string and won't be successful.</p>
  
  <p>How could I send one value as string (without <code>json_encode</code>) and some other values with <code>json_encode</code>? (so I don't <code>json_encode</code> my string)</p>
  
  <p>EDIT1:</p>
  
  <p>Here is formatting issue 1:</p>
  
  <pre><code>return 'autoOpenPopup: '.!empty($options["autoOpenPopup"]) ? $this-&gt;int_to_bool($options["autoOpenPopup"]) : $this-&gt;int_to_bool(false) . PHP_EOL .';
  </code></pre>
  
  <p>2: </p>
  
  <pre><code>return '.!isset($options["popupInit"]) ?
  
                  $playerId.' = jQuery("#'.$wrapperId.'").hap(settings);
  
              ':'
  
                  if(hasLocalStorage){
  
                      if(!localStorage.getItem("hap_popup_fixed")){
                          '.$playerId.' = jQuery("#'.$wrapperId.'").hap(settings);
                      }
                  }else{
                      '.$playerId.' = jQuery("#'.$wrapperId.'").hap(settings);  
                  }
  </code></pre>