Ok ok. By eliminating
.= and joining strings together I managed to fix some parts of the array. However there is the first part which causes [0] to show blank. How do I get around
$theresult[] = ""; not showing in
[0]=>?
The reason for avoiding is that I have a pagination code where the first page will show one less because of this:
PHP Code:
function getQuery($bigWords){
...
$theresult = array();
$theresult[] = "";
//$theresult[] = $query;
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){
$strText = $row['text_data'];
$COLORS = array('red','Teal','blue','Magenta','green','PaleGreen','orange','purple','Pink','YellowGreen','Sienna','aqua','Gray','LightBlue','MediumTurquoise','DarkRed');
for($m=0; $m < count($bigWords); $m++){
$strText = preg_replace("/(".$bigWords[$m].")/i", "<span class=\"\" id=\"\" style=\"color:".$COLORS[$m]."; font-weight:bold;\">$1</span>", $strText);
}
$theresult[] .= "<br />\n<span class=\"goToBookChapter\" style=\"font-weight: bold;\">".$row['book_title']." ".$row['chapter'].":".$row['verse']."</span><br />\n".$strText;
}
return $theresult;
echo "<br /><br />".$query."<br />";
}