Basically my data is like this
Array
(
[0] => Array
(
[projectname] => Project3
[total_requests] => 1
)
[1] => Array
(
[projectname] => RTI
[total_requests] => 1
)
[2] => Array
(
[projectname] => STAEP
[total_requests] => 3
)
)
And i want to change that data into this format using string
$mystring=" array(array('projectname', 'total_requests'),";
foreach($result as $value)
{
$mystring.= 'array('.'\''.$value['projectname'].'\''.' , '.$value['total_requests']."),";
}
$mystring.=')';
I got the desired result but it is in String i want this result in array
array(
array('projectname', 'total_requests'),
array('Project3', 1),
array('RTI', 1),
array('STAEP', 3),
),