str::xml($text, $html = true)

Converts a string to a xml-safe string. Converts it to html-safe first and then it will replace html entities to xml entities

  • $text (string)
  • $html (boolean)
    True: convert to html first
  • return (string)

Example

<?php
echo str::xml('some über crazy stuff');

// output: some &#252;ber crazy stuff

Is something missing or incorrect? Edit this page on Github…