l'errore é in JS.
la variabile in PHP é corretta, infatti se faccio un echo da php mi dà il valore giusto.
é js che non riesce a riceverla