Sample PHP/MathML

Here is sample PHP script including MathML contents

demo-mathml.php


<?php
header("Content-type: application/xhtml+xml");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
    "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Example of PHP/MathML file</title>
</head>
<body>
    <h1>Example of an PHP script, generating
        an xHTML file with MathML contents</h1>
<p>Here is a mathematical expression, embed in this PHP script:<br/>
<span style="font-size:xx-large;">
  <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
    <mfrac>
      <mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow>
      <mrow><mi>x</mi><mo>-</mo><mn>1</mn></mrow>
    </mfrac>
  </math></span>
</p>
<hr/>
</body>
</html>

Feel free to copy it and to use it as a template.

Trackbacks & Pings

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *