- Thread starter
- #1

#### Jay

##### New member

- Aug 19, 2014

- 14

I'm new here.

I'm heavily involved in math too and need a site where I can get some answers or new ideas once in a while. From what I've seen so far, this looks like a good place to visit.

I noticed that this site is written in PHP and uses LaTeX/MathJax, something I just recently discovered and have been trying to implement it on my own PHP-based web site.

Trying to figure out how to use MathJax along with PHP without conflicts is what brought me here in search of a solution from someone who may be a MathJax user and also into math coding in PHP.

Using MathJax seems simple enough and I've been converting several of the HTML pages on my web site to use MathJax expressions in place of the old JPEG graphics to display equations. The image quality is far superior.

So far, so good.

The problem I have yet to solve is using MathJax to display equations within a web page written in PHP, rather than just pure, plain HTML.

When I make an on-line calculator in PHP, below the calculator, I usually display the formulas that were used. The displayed formulas have always been ordinary GIF, PNG or JPEG images. Now I wish to use MathJax expressions to replace those graphics images. That's where the problem starts.

PHP uses the dollar sign ($) symbol to mark where computed variables are inserted into the dynamic web page while MathJax uses the dollar sign symbol within the same web page to identify blocks of math code to display. That breaks the PHP program as soon as a MathJax expression is encountered. All sorts of unpredictable gibberish results.

I'd like to know how I can write a program in pure PHP and still be able to display a MathJax expression within the page it generates without the conflicts caused by the dollar signs and other symbols.

Many of my web pages are written exclusively in PHP and I can't get the best use out of MathJax until I resolve this annoying PHP/MathJax conflict.

Thanks for any help or suggestions.