How to convert a php string variable obtained from a Javascript var to int / integer?

0

I'm trying to change the string value of a javascript string to integer. Let me explain: I have a variable PHP $ length and a variable Javascript var arrayValuesSubcategoria ...

<?php $longitud = (int) "<script>document.write(arrayValoresSubcategoria.length);</script>" var_dump($longitud);?>

What it throws is int (0) in my attempt to convert it to integer, because it seems that it reads the complete string "<script>...</script>" which is about 70 characters but when converting it to integer that too much its length. Do you have any idea how to convert it to int / integer?

    
asked by Angel Zambrano 21.10.2017 в 01:42
source

0 answers