1.如何从h4标签html中获取id的值。这个id有一个整数值作为来自我的jquery
的计数器我需要将计数传递给我的PHP代码,就像$c = chr(64 + value of id image-gallery-count)
我现在已经有近一个星期的麻烦了。希望有人代码在这里帮助我。请参阅下面的代码。$('#image-gallery-count').text($sel.data('count'));
<h4 id="image-gallery-count"></h4>
<?php $html = '<h4 id="image-gallery-count"></h4>';
$doc = new DOMDocument();
$doc->validateOnParse = true;
$doc->loadHTML($html);
$doc->preserveWhiteSpace = false;
$belement = $doc->getElementById('image-gallery-count');
echo $belement->nodeValue;
$xpath = new DOMXPath($doc);
$xpath->query("//*[@id='image-gallery-count']");
$c = chr(64 + value of id here);// I want to add the value id of <h4 id="image-gallery-count"></h4>
$b = chr(64 + 1);
?>