title: Syntax Error: Token ']' not a primary expression
body: <p>I have to send "id" of flight on which manager clicks approved so do to that i want php var to go in angular var somehow. I did this where the error mentioned in title occurs.</p>
  
  <pre><code>&lt;input type="hidden" ng-init="id[index++]='&lt;?php echo $flight['id']; ?&gt;'"&gt;
  </code></pre>
  
  <p>Any idea about which '[' is angular compiler talking about and how to write correct expression like this? Much thanks. In angular :-</p>
  
  <pre><code>$scope.id=[];
  $scope.index=0;
  </code></pre>
  
  <p>Okay i got a great answer which says to escape quote you can use '\' and now I am trying :-</p>
  
  <pre><code>&lt;input type="hidden" ng-init="id[index++]='&lt;?php echo $flight'\['id']'; ?&gt;'"&gt;
  </code></pre>
  
  <p>But it still isn't working and is giving this error "unexpected "[" at line: blah". Can anyone add "\" in my above mentioned line and plis make me get rid of this headache?</p>