if i have a function like that:
function ($form, $db) {
$v = count($a);
}
function ($form, $db);
and this code in the same file
<script type="text/javascript">
$(document).ready(function() {
for ($i=0; $i< <?php echo $v-1; ?>; $i++) {//here
}
how can i access the variable $v ? i already know that global variables are generally a bad practice, so what is the alternative?
thanks
Use
return $v: