javascript read php function
<p>How to make this working. javascript should read the php value by return and disply it.</p>

<p>thank you,</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;script type="text/javascript"&gt;

var _date = "&lt;?= 

  $xml = new DOMDocument();
  $xml-&gt;load( 'http://web.com/public.xml' );
  $elements = $xml-&gt;getElementsByTagName( "data" );

  $dates = $xml-&gt;getElementsByTagName( "i_data" );
  $_date = $dates-&gt;item(0)-&gt;nodeValue;
  return $_date;

 ?&gt;";

alert(_date)
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
