My code is....
<?php
include_once 'Includes\dba.php';
$data = array();
// Fetch comment from DB for certain module and save in array
$sql="SELECT Comment FROM module_feedback_comments WHERE module_id=1";
$result=mysqli_query($conn,$sql);
if(mysqli_num_rows($result)>0)
{
while($row = mysqli_fetch_assoc($result))
{
$data[] = $row;
}
}
$data2=array('success','t');
foreach ($data as $d)
{
echo $d['Comment']."<br>";
//echo gettype($d['Comment']);
$data2= array_merge($data2,explode(" ", $d['Comment']));
}
//counting values present in array for case insensitive by changing each array element to lowercase
$result=array_count_values(array_map("strtolower", $data2));
print_r($result); //Result 2*/
?>
Now this is giving result as:
Array ( [success] => 1 [t] => 1 [this] => 7 [is] => 7 [a] => 2 [comment] => 2 [comment2] => 1 [nnnnnnn] => 1 [fffff] => 1 [weee] => 1 [dd] => 1 [mon] => 1 [mooo] => 1 [monday] => 1 [pak] => 1 [mm] => 1 [mmmmmmm] => 1 [all] => 1 [comments] => 2 [ttt] => 1 [last] => 1 [tt] => 2 [so] => 2 [thi] => 2 [os.....] => 2 [si] => 1 [...] => 1 [too] => 1 [ff] => 1 [testing] => 1 [to] => 1 [my] => 1 )
What I want is that i can print like :
success 1
t 1
this 7
So how i can do this ? Also how i can access value in each row or column of array ?