Ok I made this change on your code and it worked:
<?php
//for overview.php
$bk2=2;
$ch2=30;
$sqlSummary = "SELECT * FROM ".strtolower($bookTitle[0]).$chapter[0]." WHERE rel_book_title = 'Genesis' AND rel_chapter = '8' ORDER BY ".$recordType[0].$chapter[0]."_ID ASC";
$resultSummary = $db->query($sqlSummary);
// Step 4: Iterate over the results
while($rowSummary = $resultSummary->fetch(PDO::FETCH_ASSOC)){
$idSummary[] = $rowSummary[$recordType[0].$chapter[0]."_ID"];
$datetimeSummary[] = $rowSummary['date_time'];
$bookSpokeSummary[] = $rowSummary['book_spoke'];
$chapterSpokeSummary[] = $rowSummary['chapter_spoke'];
$relBookSummary[] = $rowSummary['rel_book'];
$relBookTitleSummary[] = $rowSummary['rel_book_title'];
$relChapterSummary[] = $rowSummary['rel_chapter'];
$summarySummary[] = $rowSummary['summary'];
$url_linksSummary[] = $rowSummary['url_links'];
}
//print_r($summarySummary);
$rh = explode(";", $summarySummary[0]);
//print_r($rh);
$array1 = array();
for($c=0;$c<count($rh);$c++){
$rhd = explode("-", $rh[$c]);
for($d=0;$d<count($rh[$c]);$d++){
//echo $rhd[1]."<br />\n";
array_push ($array1, $rhd);
}
}
//var_export ($array1);
if ($array1)
{
$array2 = array();
foreach ($array1 as $i)
{
$color = $i[1];
//$a = array (trim ($i[2]), $color);
$a = array ($i[0], $i[1]);
if (isset ($array2[$color])) $array2[$color][] = $a;
else $array2[$color] = array ($a);
}
foreach ($array2 as $i) $keyword_colorArr[] = $i;
}
//var_export ($keyword_colorArr);
$commentsarray = array(
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
);
$highlight = array(
array(array("they that","black"))
);
give();
?>
However if I want to join other arrays how can I express within the code? I also want to associate $highlight to the 2nd array.