How do I pass JavaScript variables to PHP in yii2?
one text
Solution:
Ajax is the recommended solution. You can still use javascript inside php using document.writeln
'<script>document.writeln(data)</script>`
Sourceone text
Ajax is the recommended solution. You can still use javascript inside php using document.writeln
'<script>document.writeln(data)</script>`
Source