Home » Php » php – Mathematical symbols rendering SVG unviewable

php – Mathematical symbols rendering SVG unviewable

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am trying to display subtraction of 2 numbers with the subtraction symbol &minus; to no success. It works when i simple use - but that is not how a subtraction symbol should look like. I’ve tried with &mdash;, &divide;, &multiply; with no success. Is there a way to display these symbols in SVG within the <text> tag?

echo '<text x="165" y="'.$y_axis.'" font-size="30"
     font-family="Arial, Helvetica, sans-serif"
     fill="rgb(93, 130, 255)">
     &minus;</text>';
How to&Answers:

Instead of HTML Entity (named): &minus; it must be in HTML Entity (HEX): −. The same format applies to other symbols.