Click here to Skip to main content
14,870,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i am storing the php array value to variable and using count function i am getting
correct value like 2 and 3 based on selection.and same value i am passing to javascript like this it showing array and i am using the length function it gives always 5 while
debugging in javascript.I want get the same value which is passing from php variable .how to get the value please help me thanks in advance.

What I have tried:

PHP
$count=$_POST['check_list'];
echo "values are ".var_dump($count);
echo "count of array values are".count($count);

JavaScript
cnt='<?php echo $count; ?>';
  alert(cnt);
cnt.length();
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900