Organizational Research By

Surprising Reserch Topic

pass a php array to a javascript function


pass a php array to a javascript function  using -'I,am,trying,to,get,a,PHP,array,variable,into,a,JavaScript,variable.

This,is,my,code:

<html>
,,,,<head>
,,,,,,,,<script,type="text/javascript">
,,,,,,,,,,,,,,function,drawChart(row,day,week,month,date)
,,,,,,,,,,,,,,{
,,,,,,,,,,,,,,,,,,//,Some,code...
,,,,,,,,,,,,,,}
,,,,,,,,</script>
,,,,</head>

,,,,<body>
,,,,,,,,<?php
,,,,,,,,,,,,for($counter,=,0;,$counter<count($au);,$counter++)
,,,,,,,,,,,,{
,,,,,,,,,,,,,,,,switch($au[$counter]->id)
,,,,,,,,,,,,,,,,{
,,,,,,,,,,,,,,,,,,,,case,pageID.'/insights/page_active_users/day':
,,,,,,,,,,,,,,,,,,,,,,,,$day[],=,$au[$counter]->value;
,,,,,,,,,,,,,,,,,,,,break;
,,,,,,,,,,,,,,,,,,,,case,pageID.'/insights/page_active_users/week':
,,,,,,,,,,,,,,,,,,,,,,,,$week[],=,$au[$counter]->value;
,,,,,,,,,,,,,,,,,,,,break;
,,,,,,,,,,,,,,,,,,,,case,pageID.'/insights/page_active_users/month':
,,,,,,,,,,,,,,,,,,,,,,,,$month[],=,$au[$counter]->value;
,,,,,,,,,,,,,,,,,,,,break;
,,,,,,,,,,,,,,,,}
,,,,,,,,,,,,}
,,,,,,,,?>
,,,,,,,,<script>
,,,,,,,,,,,,drawChart(600/50,,'<?php,echo,$day;,?>',,'<?php,echo,$week;,?>',,'<?php,echo,$month;,?>',,'<?php,echo,createDatesArray(cal_days_in_month(CAL_GREGORIAN,,date('m',strtotime('-1,day')),,date('Y',strtotime('-1,day'))));,?>');
,,,,,,,,</script>
,,,,</body>
</html>

asked Sep 22, 2015 by mannumits1
edited Sep 22, 2015 by rajesh
0 votes
32 views



Related Hot Questions

4 Answers

0 votes
NULL
answered Sep 22, 2015 by mannumits1
0 votes
NULL
answered Sep 22, 2015 by rajeevr642
0 votes
NULL
answered Sep 22, 2015 by bhavin
0 votes
NULL
answered Sep 22, 2015 by badhwar.rohit

...