Get inner html with php
I started learning php and I came accross this issue. I have the html code in my form:
<label for="u">Usability <span id='u_score'>0</span> / 7</label>
I want to get the inner html of the span with id u_score. How do I do this in php? Any help would be appreciated.
I have already tried
$u_score = $_POST["u_score"];
but that returns undefined because there is no value associated with the span.
What you can do is to copy the span text content into a hidden input which will be posted:
Then you can get the value from PHP with $_POST['u_score_value'].