需要使用php抓取HTML内容和Id然后回显吗?

The following is an example of my HTML page followed by a piece of the corresponding PHP page that is handling the form. I need to get the HTML content (ie the string) from the id and echo it using PHP. The hold the results of some equations. I want the PHP to handle the results and echo them into a well organized table.

HTML

<span id="a" name="a"></span>
<span id="b" name="b"></span>

When a function runs it inserts the answers into the id's a and b. Now I want to echo these answers using PHP when the form is submitted.

First of all, make a form, if you don't know how to then take a look at this:

http://www.w3schools.com/html/html_forms.asp

Then learn the post method to post the data that you want to echo, currently you have no form so it's not going to work. Or maybe you do but are not showing us, if that is the case please put all you code on.