# Thread: Hi - I'm a LaTeX/MathJax Newbie

1. Hello, and welcome to MHB, arinmath!

It appears to me you wish to display some $\LaTeX$ on your web page. You don't need to use PHP to do this, you can simply put the code(s) wrapped in the dollar tags as text within the appropriate HTML elements.

I want to create some multiple choice questions. The questions are kept in an array. Suppose the array contains 100 questions. Some of the questions contains Latex equations. I want to display only 10 questions randomly. In that situation, it is essential to use php.
With regards,
India.

3. What I would likely do to create and easily maintain a bank of randomly chosen questions is to store them in one long string, delimited by line breaks, e.q.:

And then explode this string into an array:

Then, use a while loop to randomly choose questions from the array (keeping track of questions already selected so they are only selected once). As the questions are chosen, wrap them in whatever HTML you want along with $\LaTeX$ tags, and concatenate them into a single string. Then echo this string to the page in the appropriate place.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•