How to use my PHP function in JavaScript code
<p>I'm trying to use my PHP function in JavaScript like this:</p>

<p>PHP code:</p>

<pre><code>function checkevents($date){
    $ev = new CalendarModelEventss();
    $wh = "`event_date` = '".$date."'";
    $all = $ev-&gt;getAllEvents('event_date', $wh);
    if($all == $date){
        //echo 'event is available'.$all;   
        return true;
    } else {
        return false;
        //echo 'event is NOT available' .'--'. $all;
    }
}
</code></pre>

<p>and JavaScript code:</p>

<pre><code>var yyyy = date.getLocalFullYear(true, this.dateType);
var mm = date.getLocalMonth(true,this.dateType);
var dd = iday;
var ddddd = yyyy+'/'+mm+'/'+dd;

if(&lt;?php checkevents( ?&gt;ddddd&lt;?php ) ?&gt;){
     cell.className += " eventsss ";
}
</code></pre>

<p>but it doesn't work, and I have PHP error (<code>syntax error, unexpected ';', expecting ')' in ...</code>).</p>
