title: Escape string value for plist with php
body: <p>How can I escape a string containing random characters with php for a plist file? <code>htmlentities()</code> seems doesn't seem to be strict enough. For example:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
      &lt;string&gt;&lt;?php echo htmlentities("@!£$%^&amp;*)}{:|&lt;&gt;/");?&gt;&lt;/string&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>doesn't work.</p>