Get current HTML element in PHP
<p>I may have misunderstood the purpose of PHP here. But I want to do the following:</p>

<p>I have a PHP function, and I call it from HTML, e.g. </p>

<pre><code>  &lt;BODY&gt;
    &lt;DIV id='A'&gt;
      &lt;?php emit("hello1"); ?&gt;
    &lt;/DIV&gt;
    &lt;DIV id='B'&gt;
      &lt;?php emit("hello2"); ?&gt;
    &lt;/DIV&gt;
  &lt;/BODY&gt;      
</code></pre>

<p>And I want to know, within the function, which <code>DIV</code> it was called from.
e.g.</p>

<pre><code>  &lt;?php function emit($txt){
           echo "$txt";
           echo "from DIV id $DIVID"
        } 
  ?&gt;
</code></pre>

<p>And I want it, obviously, to print</p>

<pre><code>hello1 from DIV id A
hello2 from DIV id B
</code></pre>

<p>Is there any way of finding the "current" DIV's ID?</p>
