Can any one help me parsing this code in php
My Code:
[CODE]
<statement>
The following program will calculate the logarithm of x to the base b using the following formula: The source code missed some important keywords or reserved identifiers. Please complete the source code by filling the blanks using any of the following keywords or reserved identifiers: program, implicit, read, write, integer, real, character, log.
program logarithm
implicit none
real::b, x, result
<answer class=”inline”>write</answer>(*,*) “please enter the base of the logarithm:”
<answer class=”inline”> read</answer>(*,*) b
<answer class=”inline”>write</answer>(*,*) “please enter the input value of x for its log with the above base”
<answer class=”inline”> read</answer>(*,*) x
write(*,*) “Now I will calculate log_b(x) for you:”
result = log(x)/log(b)
<answer class=”inline”>write</answer>(*,*) “The result is “, result
end program
</statement>
I Know how to parse xml tags in php using simplexml_load_string my question is I want to extract all the above data into to php variable and at the time of parsing when ever I read <answer> tag I want to replace the whole tag with <input type=”text”>… More or less I want to display a filling the blank question on html page by parsing this xml file.
Thanks in advance