What I have is this:
<span style="font-weight: bold; color: darkslategray">take</span>, <span style="font-weight: bold; color: darkslategray">taking</span>, <span style="font-weight: bold; color: darkslategray">took</span>, <span style="font-weight: bold; color: darkorange">with</span>, <span style="font-weight: bold; color: darkorange"> for </span>, <span style="font-weight: bold; color: yellowgreen"> son</span>, <span style="font-weight: bold; color: mediumturquoise">water</span> and <span style="font-weight: bold; color: cyan">earth</span>.
If I set up an array manually this is the way I want:
$keyword_colorArr = array( array(array("take","darkslategray"), array("taking","darkslategray"), array("took","darkslategray")), array(array("with","darkorange"), array("for","darkorange")), array(array("son","yellowgreen")), array(array("water","mediumturquoise")), array(array("earth","cyan")) );
I was trying it out but it didn’t work:
`$rh = explode(“;”, $summarySummary[0]);
//print_r($rh);
$keyword_colorArr = array();
for($c=0;$c<count($rh);$c++){
$rhd = explode(“-”, $rh[$c]);
for($d=0;$d<count($rh[$c]);$d++){
echo $rhd[1].“
\n”;
$n = $d+1;
if(($rhd[$d]==$rhd[$n])){
//implode($rh[$c]);
array_push ($keyword_colorArr, array($rhd[$n], $rhd[$d]));
}else{
array_push ($keyword_colorArr, $rhd);
}
}
}
var_dump($keyword_colorArr);`