返回时递增值不递增[重复]

This question already has an answer here:

this is what i am doing. I am incrementing php var through a function like:

<?php $j=1; ?>

jQuery('.mysubmitbuttin').click(function(){

increment();

});

function increment()
{
    var inc = '<?php echo $j=$j+1; ?>';
    alert(inc);
    return inc;
}

the alert inc showing 2 everytime. php var $j is not incrementing the value. why is it so?

</div>

php-code is only executed once on the SERVER ! before you get the DOM-Element