I have two foreach loops: 1st one:
foreach ($items as $key => $item)
{
$keywords = explode(\' \', $qsvarus);
$title[$key]
The best answer is probably from Jack, but I thought my solution was interesting. I also tried to improve your code:
do {
if ($item = current($items)) {
$key = key($items);
$keywords = str_replace(' ', '|');
list($infoo_str, $title_str) = preg_replace(
"/\b({$keywords})\b(?![^<]*[>])/i",
'$0',
array($infoo[$key], $title[$key])
);
echo "{$infoo_str}{$title_str}{$item} ";
next($items);
}
if ($linkas = current($linkai)) {
$characters = array('download/', '&', 'amp;nbsp;', '/i/');
$replacements = array('files/', '&', ' ', '/IMG/');
$linkas = str_replace($characters, $replacements, $linkas);
echo "";
next($linkai);
}
} while ($item or $linkas);