call php function in js | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

call php function in js

i need to call php func in js with pass parameter(js variable) to func: this worked: let fulld = "<?= gregorian_to_jalali('2023', '10', '2', '/'); ?>"; but for this i got syntax error: syntax error, unexpected token ";" let year = date.getFullYear(); let fulld = "<?= gregorian_to_jalali(?>"+year+"<?, '10', '2', '/'); ?>"; what is problem?

4th Oct 2023, 5:45 PM
Hadi
Hadi - avatar
1 ответ
+ 2
Write php inside this <?php ?> you cannot use JavaScript variable in Php script
5th Oct 2023, 10:09 AM
A͢J
A͢J - avatar